简体   繁体   中英

Import error when trying to import tensorflow with gpu

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.

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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