简体   繁体   English

在Anaconda中安装Tensorflow的问题

[英]Issues installing tensorflow in anaconda

I've been using the anaconda installation on their site . 我一直在他们的网站上使用anaconda安装。 It seems to work and I'm able to create the tensor flow environment. 它似乎可以工作,并且我能够创建张量流环境。 After this, I seem to encounter some issues. 在这之后,我似乎遇到了一些问题。 I move from my terminal to my Ipynb and try import tensorflow as tf and I get the following error: 我从终端移到我的Ipynb并尝试import tensorflow as tf并得到以下错误:

ImportError: dlopen(/Users/madhavthaker/Downloads/anaconda/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow.so, 10): Library not loaded: @rpath/libcudart.8.0.dylib
  Referenced from: /Users/madhavthaker/Downloads/anaconda/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow.so
  Reason: image not found

I did some googling and found this which says I may be running the script in the same directory as tensorflow. 我做了一些谷歌搜索,发现表明我可能正在与tensorflow相同的目录中运行脚本。 This seems simple but I don't know how to go about doing this. 这似乎很简单,但是我不知道该怎么做。

Any help would be much appreciated. 任何帮助将非常感激。

This error message is displayed if you install the GPU-enabled Mac OS version of TensorFlow on a machine that does not have CUDA installed. 如果在未安装CUDA的计算机上安装TensorFlow的启用GPU的Mac OS版本的TensorFlow,则会显示此错误消息。

To fix this, you can try doing either of the following. 要解决此问题,您可以尝试执行以下任一操作。

Remove the conda package, and install the CPU only version. 删除conda程序包,并安装仅CPU版本。

# Mac OS X, CPU only, Python 2.7:
conda remove tensorflow
conda install -c conda-forge tensorflow=0.10.0

You can see the package here - https://anaconda.org/conda-forge/tensorflow 您可以在这里看到软件包-https: //anaconda.org/conda-forge/tensorflow

Use Pip instead of Anaconda 使用Pip代替Anaconda

Make a new environment or remove the package from conda and try the following: 创建一个新环境或从conda中删除该软件包,然后尝试以下操作:

# Mac OS X, CPU only, Python 2.7:
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.10.0rc0-py2-none-any.whl
$ sudo pip install --upgrade $TF_BINARY_URL

Hope this helps! 希望这可以帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM