tensorflow / models

Models and examples built with TensorFlow
Other
77.18k stars 45.75k forks source link

Error when import tensorflow (GPU computer, Ubuntu 14) #1940

Closed minhncsocial closed 7 years ago

minhncsocial commented 7 years ago

System information

commands: conda create -n tensorflow source activate tensorflow pip install --ignore-installed --upgrade \ https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.2.1-cp27-none-linux_x86_64.whl

nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2016 NVIDIA Corporation Built on Tue_Jan_10_13:22:03_CST_2017 Cuda compilation tools, release 8.0, V8.0.61 I installed this cudnn: cudnn-7.0-linux-x64-v4.0-prod.tgz

processor : 63 vendor_id : GenuineIntel cpu family : 6 model : 63 model name : Intel(R) Xeon(R) CPU E5-2698 v3 @ 2.30GHz stepping : 2 microcode : 0x38 cpu MHz : 1200.671 cache size : 40960 KB physical id : 1 siblings : 32 core id : 15 cpu cores : 16 apicid : 63 initial apicid : 63 fpu : yes fpu_exception : yes cpuid level : 15 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid bogomips : 4591.54 clflush size : 64 cache_alignment : 64 address sizes : 46 bits physical, 48 bits virtual power management:

mkdir downloads cd downloads wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/cuda-repo-ubuntu1404_8.0.61-1_amd64.deb sudo dpkg -i cuda-repo-ubuntu1404_8.0.61-1_amd64.deb

sudo apt-get upgrade -y sudo apt-get install -y opencl-headers build-essential protobuf-compiler \ libprotoc-dev libboost-all-dev libleveldb-dev hdf5-tools libhdf5-serial-dev \ libopencv-core-dev libopencv-highgui-dev libsnappy-dev libsnappy1 \ libatlas-base-dev cmake libstdc++6-4.8-dbg libgoogle-glog0 libgoogle-glog-dev \ libgflags-dev liblmdb-dev git python-pip gfortran

sudo apt-get clean sudo apt-get install -y linux-image-extra-uname -r linux-headers-uname -r linux-image-uname -r sudo apt-get install -y cuda sudo apt-get clean

echo 'export PATH=$PATH:/usr/local/cuda-8.0/bin' >> ~/.bashrc echo 'export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64' >> ~/.bashrc

source ~/.bashrc

wget https://s3-eu-west-1.amazonaws.com/poc-ocr-caffe/cudnn-7.0-linux-x64-v4.0-prod.tgz tar -zxf cudnn-7.0-linux-x64-v4.0-prod.tgz cd cuda sudo cp lib64/* /usr/local/cuda/lib64/ sudo cp include/cudnn.h /usr/local/cuda/include/

cd ~/downloads wget http://repo.continuum.io/archive/Anaconda2-4.2.0-Linux-x86_64.sh

bash ./Anaconda2-4.2.0-Linux-x86_64.sh

sudo apt-get install graphviz sudo apt-get install python-opencv conda install opencv pip install lmdb pip install pydot

conda create -n tensorflow01 source activate tensorflow01 pip install --ignore-installed --upgrade \ https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.2.1-cp27-none-linux_x86_64.whl

python import tensorflow as tf

You can collect some of this information using our environment capture script:

https://github.com/tensorflow/tensorflow/tree/master/tools/tf_env_collect.sh

You can obtain the TensorFlow version with

python -c "import tensorflow as tf; print(tf.GIT_VERSION, tf.VERSION)"

Describe the problem

After install tensorflow for GPU by anaconda, I try testing code but get the error, even just import tensorflow.

Source code / logs

(tensorflow01) arlab06@DGX-1:~/minh/Downloads$ python
Python 2.7.12 |Anaconda custom (64-bit)| (default, Jul  2 2016, 17:42:40)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
>>> import tensorflow as tf
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/arlab06/minh/SETUP/anaconda2/lib/python2.7/site-packages/tensorflow/__init__.py", line 24, in <module>
    from tensorflow.python import *
  File "/home/arlab06/minh/SETUP/anaconda2/lib/python2.7/site-packages/tensorflow/python/__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "/home/arlab06/minh/SETUP/anaconda2/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 52, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "/home/arlab06/minh/SETUP/anaconda2/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 41, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "/home/arlab06/minh/SETUP/anaconda2/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "/home/arlab06/minh/SETUP/anaconda2/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
ImportError: /home/arlab06/minh/SETUP/anaconda2/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so: undefined symbol: cudnnSetDropoutDescriptor

Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/install_sources#common_installation_problems

for some common reasons and solutions.  Include the entire stack trace
above this error message when asking for help.
martinwicke commented 7 years ago

You cannot use the prebuilt binaries with a cuda/cudnn version they have not been built against. They are not built against cudnn7, so they won't work with cudnn7.

minhncsocial commented 7 years ago

Thank you very much.

I got it. So now I install another way, and works now.

https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon Virus-free. www.avast.com https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Fri, Jul 14, 2017 at 2:55 AM, Martin Wicke notifications@github.com wrote:

You cannot use the prebuilt binaries with a cuda/cudnn version they have not been built against. They are not built against cudnn7, so they won't work with cudnn7.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tensorflow/models/issues/1940#issuecomment-315169936, or mute the thread https://github.com/notifications/unsubscribe-auth/AVJ-Zp6LatCOuZE5orwEn8avVFerEbO4ks5sNmgogaJpZM4OWp5J .

--

NGUYEN CONG MINH / Master Studentminhnc.social@gmail.com / (0886)979-038-464

National Taipei University of Technologyhttp://www.ntut.edu.tw/