我爱编程

3.14

2018-03-15  本文已影响0人  M子墨

今天继续在虚拟机上搭建tensorflow环境。

遇到了几个问题:

1、“IOError: [Errno 13] Permission denied:”ubuntu的权限问题,最后用一行“sudo su"解决了。

2、起初错装了gpu的tensorflow(https://mirrors.tuna.tsinghua.edu.cn/tensorflow/linux/),可以成功安装但无法调用会报错。

{Traceback (most recent call last):

  File "", line 1, in

  File "/home/ge/.local/lib/python2.7/site-packages/tensorflow/__init__.py", line 24, in

    from tensorflow.python import *

  File "/home/ge/.local/lib/python2.7/site-packages/tensorflow/python/__init__.py", line 49, in

    from tensorflow.python import pywrap_tensorflow

  File "/home/ge/.local/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 52, in

    raise ImportError(msg)

ImportError: Traceback (most recent call last):

  File "/home/ge/.local/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 41, in

    from tensorflow.python.pywrap_tensorflow_internal import *

  File "/home/ge/.local/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in

    _pywrap_tensorflow_internal = swig_import_helper()

  File "/home/ge/.local/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: libcusolver.so.8.0: cannot open shared object file: No such file or directory

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}

3、关于pip install -i:

    pip install tensorflow -i https://mirrors.tuna.tsinghua.edu.cn/tensorflow/linux/cpu/tensorflow-1.3.0rc0-cp27-none-linux_x86_64.whl

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple/   https://mirrors.tuna.tsinghua.edu.cn/tensorflow/linux/cpu/tensorflow-1.3.0rc0-cp27-none-linux_x86_64.whl

这两个是不一样的的一个就会报错,第二才是从指定地方安装包的方法。

(刚开始,没看清课件,写错了,郁闷了老会。要认真啊!)

上一篇下一篇

猜你喜欢

热点阅读