Tensoflow: How to solve "ImportError: libcudnn.so.6:" - tensorflow

i used tensorflow ver0.12.0. i wanna use ver 0.10 so i run pip install tensorflow
then when i use tensorflow ,
`Traceback (most recent call last):
File "image_zooms_training.py", line 6, in
from keras.models import Sequential
File "/home/satan/anaconda3/envs/py27/lib/python2.7/site-packages/keras/init.py", line 2, in
from . import backend
........
ImportError: libcudnn.so.6: cannot open shared object file: No such file or directory
Failed to load the native TensorFlow runtime.
`
this error is happend .
Please tell me how to solve.
Thank you for your help.
enviroment
ubuntu14.04
python2.7

download libcudnn.so.6 in https://developer.nvidia.com/cudnn.
put it to /usr/local/cuda/lib64/ folder
and use next commond
sudo chmod u=rwx,g=rx,o=rx libcudnn.so.6.5.18
sudo ln -s libcudnn.so.6.5.18 libcudnn.so.6
sudo ln -s libcudnn.so.6 libcudnn.so

Change directory to
/home/username/anaconda3/envs/tensorflow/lib/

Related

Bootstrap issue on AWS EMR-5.30.0

I'm trying to create a EMR cluster version 5.30.0 by using bootstrap script and I got an error messages
Terminated with errors On the master instance (xxxxxxx), bootstrap action 1 returned a non-zero
Anyone know the cause of this problem?
Cluster info
Release label:emr-5.30.0
Hadoop distribution:Amazon 2.8.5
Applications: Hive 2.3.6, Spark 2.4.5, Livy 0.7.0, ZooKeeper 3.4.14
bootstrap script
#!/bin/bash -xe
sudo python3 -m pip install matplotlib pandas spark-nlp
error message
Collecting matplotlib
Downloading https://files.pythonhosted.org/packages/ad/62/7b662284352867a86acfb636761ba351723fc3a235efd8397578d903413d/matplotlib-3.5.3-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (11.2MB)
Collecting pandas
Downloading https://files.pythonhosted.org/packages/99/f0/f99700ef327e51d291efdf4a6de29e685c4d198cbf8531541fc84d169e0e/pandas-1.3.5.tar.gz (4.7MB)
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/mnt/tmp/pip-build-j8xr47sb/pandas/setup.py", line 18, in <module>
import numpy
ModuleNotFoundError: No module named 'numpy'
I tried to change commands in bootstrap script. such as below.
#!/bin/bash -xe
sudo pip3 install -U \
matplotlib \
pandas

Unable to run training command for LaBSE

I am trying to reproduce the fine-tuning stage of LaBSE[https://github.com/tensorflow/models/tree/master/official/projects/labse] model.
I have cloned the tensorflow/models repository. Set the enironment path as follows.
%env PYTHONPATH='/env/python:/content/drive/MyDrive/Colab_Notebooks/p3_sentence_similiarity/models'
!echo $PYTHONPATH
output: '/env/python:/content/drive/MyDrive/Colab_Notebooks/p3_sentence_similiarity/models'
installed pre-requisites
!pip install -U tensorflow
!pip install -U "tensorflow-text==2.10.*"
!pip install tf-models-official
Then I try to run the labse training command in readme.md.
python3 /content/drive/MyDrive/Colab_Notebooks/p3_sentence_similiarity/models/official/projects/labse/train.py \
--experiment=labse/train \
--config_file=/content/drive/MyDrive/Colab_Notebooks/p3_sentence_similiarity/models/official/projects/labse/experiments/labse_bert_base.yaml \
--config_file=/content/drive/MyDrive/Colab_Notebooks/p3_sentence_similiarity/models/official/projects/labse/experiments/labse_base.yaml \
--params_override=${PARAMS} \
--model_dir=/content/drive/MyDrive/Colab_Notebooks/p3_sentence_similiarity/models \
--mode=train_and_eval
Issue
I get the following error.
File "/content/drive/MyDrive/Colab_Notebooks/p3_sentence_similiarity/models/official/projects/labse/train.py", line 23, in
from official.projects.labse import config_labse
ModuleNotFoundError: No module named 'official.projects.labse'
The import statement python from official.projects.labse import config_labse fails
System information
I executed this on colab as well as in a GPU machine. However in both environments I get the same error.
I need to know why the import statement failed and what corrective action should be taken for this.

Tensorflow 1.4 looking for libcudnn.so.6 rather than libcudnn.so.8

I am installed tensorflow 1.4.1 on two gpu machines. After installation , one send an error message that
ImportError: libcudnn.so.8: cannot open shared object file: No such file or directory
After setting PATH and LD_LIBRARY_PATH. It works for me.
But the other machine send an error message as
ImportError: libcudnn.so.6: cannot open shared object file: No such file or directory
But I don't have such installed. Could someone explain why they looking for different version of libcudnn.so? And how to fix this?
download libcudnn.so.6 in https://developer.nvidia.com/cudnn. put it to /usr/local/cuda/lib64/ folder and use next commond
sudo chmod u=rwx,g=rx,o=rx libcudnn.so.6.5.18
sudo ln -s libcudnn.so.6.5.18 libcudnn.so.6
sudo ln -s libcudnn.so.6 libcudnn.so
or change the folder to /home/username/anaconda3/envs/tensorflow/lib/

pkg_resources.DistributionNotFound for Ryu-oe

My goal is to have a optical LINC switch running and use Ryu-oe to control it.
I receive the following error when I try to run Ryu-Oe instruction from this link.
Ryu-oe is just ryu controller with some optical extensions.
File "/usr/local/bin/ryu-manager", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2749, in <module>
working_set = WorkingSet._build_master()
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 446, in _build_master
return cls._build_from_requirements(__requires__)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 459, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 628, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: msgpack-python>=0.4.0
Anyone knows how I can solve the error?
Ok it seems that the problem is solved. To be honest I don't know how it was solved. Here are some of the commands I ran:
Make sure you are in ryu-oe directory.
sudo -H ./run_tests.sh
sudo ./run_tests.sh
sudo -H python ./setup.py install
and then I ran sudo ryu-manager ~/ryu-oe/ryu/app/ofctl_rest.py.
Let me know which one worked for you so that we come up with a better answer.
This command worked for me:
$ sudo pip install --upgrade msgpack-python

How to install MySQLDb adaptor in zope?

I am trying to install MySQLDB adaptor in zope. I have a mac book pro with snow leopard. I have downloaded the "MySQL-python-1.2.0.
from: http://old.zope.org/Members/adustman/Products/MySQLdb/
I extracted the file in /usr/local/zope/lib/python/products
and then I changed directory to it:
cd MySQL-python-1.2.0
And I typed:
sudo /Users/dkar/Desktop/zope/bin/python setup.py build
sudo /User/dkar/Desktop/zope/bin/python setup.py install
I get this error:
Traceback (most recent call last):
File "setup.py", line 34, in ?
mysqlstatic = eval(os.getenv('mysqlstatic', 'False'))
File "<string>", line 0, in ?
NameError: name 'False' is not defined
I see the lines 0 and 34 in the setup.py but I don't know what should I do. Any suggestions what to do? I am new in these things and I don't have any idea how to solve this issue.
Please let me know if you don't understand some part and I will try to explain it better!
Environment that was used:
Debian 2.6.32-5-amd64
Plone 4.3.10
MySQL Server 5.1.49-3
Python-MySQL 1.2.3
ZMySQLDA
Step by step...
Install Plone
Install MySQL, in this exemple I install using apt-get install mysql-server
Install another dependecies apt-get install libmysqlclient-dev
Edit base.cfg or buildout.cfg in eggs add:
eggs =
MySQL_python
In buildout.cfg at the bottom add:
[zmysqlda]
recipe = collective.recipe.zmysqlda
target = ${buildout:directory}/products
run buildout bin/buildout -v
edit DABase.py at the line 92 and the file DA.py line 96
Where have: from ImageFile import ImageFile
Change to: from App.ImageFile import ImageFile
create a folder that the script request:
mkdir -p /{buildout_folder}/buildout-cache/eggs/Zope2-2.13.12-py2.6.egg/Shared/DC/ZRDB/www
Put the icon that don't exist in the folder
wget http://old.zope.org/Documentation/Guides/ZSQL-HTML/DBAdapterFolder_icon.gif
run buildout again.
In zope interface management add Z MySQL database connection
Enter Database conection string:
I hope help yoU!
I extract this cookbook from my post here: http://julianoaraujo.objectis.net/blog/pzp/400320287, it's in Brazilian Portuguese.
I don't know what causes the strange error you get so I'm not sure if my answer will help you. I also had trouble installing mySQLdb. I found out that mysql has to be installed on your system, even if you do not intend to use it with mySQLdb (maybe you just want to use it with a remote connection).
Before building and installing, you have to edit site.cfg and set the path to your mysql_config (which on my mac is: /usr/local/mysql/bin/mysql_config). Then make a symlink, so that your mysql client will be found:
sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib
Hope that helps :)