Import error when trying to import tensorflow with gpu

那年仲夏 提交于 2019-12-10 18:07:15

问题


ImportError: libcuda.so.1: cannot open shared object file: No such file or directory
Failed to load the native TensorFlow runtime.

This error is appeared when import tensorflow. I need to know steps to solve this problem.


回答1:


If you are using TensorFlow with GPU, you need to install CUDA and cuDNN. Please follow instructions on https://www.tensorflow.org/install/

If you have already install CUDA and cuDNN, but still get this error, then you probably forgot to export your libraries: for Linux, you may need to set LD_LIBRARY_PATH to include CUDA libraries.




回答2:


After installing TensorFlow 1.11 GPU via Anaconda "conda install tensorflow-gpu" I also experienced the same problem. Before TF 1.11 I used TF 1.04. Just before the TF update I updated Nvidia Driver to the version 396 through ppa.

There was no trace of libcuda.so.1 in my entire linux.

After many trials, the problem was solved when I changed the nvidia driver to 390. The 390 version inserted libcuda.so.1 to /usr/lib/i386-linux-gnu directory, which evidently solved the problem.



来源:https://stackoverflow.com/questions/47063919/import-error-when-trying-to-import-tensorflow-with-gpu

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!