sudo nvidia-docker run -p 8888:8888  --name tf1.11_py3 -it   -v /home/wang/:/home/wang 0641cda31e80

解决了下面问题:

>>> import tensorflow

Traceback (most recent call last):

  File "<stdin>", line 1, in <module>

  File "/usr/local/lib/python2.7/dist-packages/tensorflow/__init__.py", line 22, in <module>

    from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import

  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/__init__.py", line 49, in <module>

    from tensorflow.python import pywrap_tensorflow

  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 74, in <module>

    raise ImportError(msg)

ImportError: Traceback (most recent call last):

  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>

    from tensorflow.python.pywrap_tensorflow_internal import *

  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>

    _pywrap_tensorflow_internal = swig_import_helper()

  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper

    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)

Tensorflow import 出错,ImportError: libcuda.so.1: cannot open shared object file: No such file or directory

启动docker时,原来使用的是:

sudo docker run -p 8888:8888  --name tf1.11_py2 -it   -v /home//wang/:/home//wang 0641cda31e80

更改为

sudo nvidia-docker run -p 8888:8888  --name tf1.11_py3 -it   -v /home/wang/:/home/wang 0641cda31e80

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐