简体   繁体   English

张量流的libcublas.so.8.0错误

[英]libcublas.so.8.0 error with tensorflow

I am currently trying to run a project from GitHub: https://github.com/nilboy/pixel-recursive-super-resolution 我目前正在尝试从GitHub运行一个项目: https//github.com/nilboy/pixel-recursive-super-resolution

After installing ubuntu on VM, I installed python with tensorflow 2.7 using the pip command. 在VM上安装ubuntu后,我使用pip命令安装了具有tensorflow 2.7的python。

When I try to run the training session with python I get this error: 当我尝试使用python运行训练会话时,我收到此错误:

ImportError: libcublas.so.8.0: cannot open shared object file: No such file or directory ImportError:libcublas.so.8.0:无法打开共享对象文件:没有这样的文件或目录

I could't find anything exactly the same, only this error: ImportError: libcudart.so.8.0: cannot open shared object file 我找不到任何完全相同的东西,只有这个错误: ImportError:libcudart.so.8.0:无法打开共享对象文件

I am using Yoga 13, so I don't have an NVIDIA GPU and I am trying to run this project on the CPU. 我使用的是Yoga 13,所以我没有NVIDIA GPU,我试图在CPU上运行这个项目。 Can you help identify the tensorflow problem? 你能帮助识别张量流问题吗?

Source: https://www.tensorflow.org/install/install_linux 资料来源: https//www.tensorflow.org/install/install_linux

You need to install Cuda 8.0 and configure the environment as below: 您需要安装Cuda 8.0并配置如下环境:

export PATH="$PATH:/usr/local/cuda-8.0/bin"
export LD_LIBRARY_PATH="/usr/local/cuda-8.0/lib64"

may be preinstalled tensorflow-gpu, so 可能是预装的tensorflow-gpu,所以

pip3 install tensorflow --ignore-installed pip3安装tensorflow --ignore-installed

as this helped me from stackoverflow 因为这帮助我从stackoverflow

Tensroflow/Keras requirements Tensroflow / Keras要求

In my opinion the tricky steps are installing Nvidia drivers and Cuda-8. 在我看来,棘手的步骤是安装Nvidia驱动程序和Cuda-8。 If you follow the instructions you're gonna have a bad time. 如果按照说明操作,那将是一段不愉快的时光。 Instead install it thru apt : 而是通过apt安装它:

sudo apt-get install nvidia-384 #can type nvidia then hit "tab" to view all available options
sudo apt-get install cuda-8-0

If that doesn't work...good luck. 如果这不起作用......祝你好运。 You can try this: 你可以试试这个:

Check that you do not have cuda-9: ls /usr/local 检查你没有cuda-9: ls /usr/local

Install Cuda 8.0. 安装Cuda 8.0。

Reboot 重启

Run export LD_LIBRARY_PATH=/usr/local/cuda-8.0/extras/CUPTI/lib64:$LD_LIBRARY_PATH but replace /usr/local/cuda-8.0/extras/CUPTI/lib64 with the relevant output from echo $LD_LIBRARY_PATH 运行export LD_LIBRARY_PATH=/usr/local/cuda-8.0/extras/CUPTI/lib64:$LD_LIBRARY_PATH但将/usr/local/cuda-8.0/extras/CUPTI/lib64替换为echo $LD_LIBRARY_PATH的相关输出

Check that it worked nvcc --version prints out CUDA version 检查它是否有效nvcc --version打印出CUDA版本

It may be an issue with the CUDA version installed. 这可能是安装CUDA版本的问题。 try 尝试
$ sudo apt-get install cuda-8-0 $ sudo apt-get install cuda-8-0

I got the same error while running Tensorflow with GPU support in Python and solved it like this: 我在Python中使用GPU支持运行Tensorflow时遇到了同样的错误并解决了这个问题:

$ export PATH="$PATH:/usr/local/cuda-8.0/bin" 
$ export LD_LIBRARY_PATH="/usr/local/cuda-8.0/lib64"

For enabling all users you may have to enter these export statements in etc/environments in Ubuntu 为了启用所有用户,您可能必须在Ubuntu中的etc / environment中输入这些导出语句

On my computer I had : 在我的电脑上我有:

cudnn5.1,   
cuda8.0

When importing tensorflow, I had the same error ImportError: 导入tensorflow时,我遇到了同样的错误:ImportError:

libcublas.so.8.0: cannot open shared object file: No such file or directory libcublas.so.8.0:无法打开共享对象文件:没有这样的文件或目录

and even 乃至

libcublas.so.9.0: cannot open shared object file: No such file or directory libcublas.so.9.0:无法打开共享对象文件:没有这样的文件或目录

To overcome this issue I installed tensorflow 1.4 instead of 1.6 and did what Umair Qadir suggested. 为了解决这个问题,我安装了tensorflow 1.4而不是1.6,并且做了Umair Qadir所建议的。

But then I had another issue : 但后来我又遇到了另一个问题:

libcudnn.so.6: cannot open shared object file: No such file or directory libcudnn.so.6:无法打开共享对象文件:没有这样的文件或目录

This was because I had cudnn5.1 as required but actually it needs cudnn6 这是因为我根据需要有cudnn5.1但实际上它需要cudnn6

Here are the steps to uninstall cudnn5.1 and install cudnn6: 以下是卸载cudnn5.1并安装cudnn6的步骤:

1- Uninstall cudnn 5.1 rm -f /usr/include/cudnn.h rm -f /usr/lib/x86_64-linux-gnu/libcudnn rm -f /usr/local/cuda-/lib64/libcudnn 1-卸载cudnn 5.1 rm -f /usr/include/cudnn.h rm -f / usr / lib / x86_64-linux-gnu / libcudnn rm -f / usr / local / cuda- / lib64 / libcudnn

2- Install cudnn6 2-安装cudnn6

After having subscribed to nvdia, go to here https://developer.nvidia.com/rdp/cudnn-download and download cudnn6 for cuda8 and then go to the folder where you downloaded the cudnn and do : 订阅了nvdia后,请访问https://developer.nvidia.com/rdp/cudnn-download并下载cudnn6 for cuda8,然后转到下载cudnn的文件夹并执行:

$ tar xvzf cudnn-8.0-linux-x64-v5.1-ga.tgz
$ sudo cp -P cuda/include/cudnn.h /usr/local/cuda/include
$ sudo cp -P cuda/lib64/libcudnn /usr/local/cuda/lib64
$ sudo chmod a+r /usr/local/cuda/include/cudnn.h 
/usr/local/cuda/lib64/libcudnn*

Now you should have tensorflow 现在你应该有张量流

Try it on typing in the console: 在控制台中输入时尝试:

$python
import tensorflow

If you want to work in anaconda and the error persists , try : 如果你想在anaconda工作并且错误仍然存​​在,请尝试:

$jupyter notebook --generate-config

then you can find the name of the directory where you have your config file (Ill call it 然后你可以找到你的配置文件的目录名称(我称之为

) and open /jupyter_notebook_config.py and add at the top : )并打开/jupyter_notebook_config.py并在顶部添加:

import os
c = get_config()
os.environ['LD_LIBRARY_PATH'] = '/usr/local/cuda-8.0/lib64:usr/local/cuda-8.0/lib64/libcudart.so.8.0'
c.Spawner.env.update('LD_LIBRARY_PATH')

Now it should work... 现在它应该工作......

Here are the websites that helped me: 以下是帮助我的网站:

https://askubuntu.com/questions/952075/how-to-upgrade-tensorflow-to-v1-3-cudnn-cuda-upgrade https://developer.nvidia.com/rdp/cudnn-download https://medium.com/@ikekramer/installing-cuda-8-0-and-cudnn-5-1-on-ubuntu-16-04-6b9f284f6e77 tensorflow gpu can not be called from jupyterhub/jupyter notebook, why? https://askubuntu.com/questions/952075/how-to-upgrade-tensorflow-to-v1-3-cudnn-cuda-upgrade https://developer.nvidia.com/rdp/cudnn-download https:// medium.com/@ikekramer/installing-cuda-8-0-and-cudnn-5-1-on-ubuntu-16-04-6b9f284f6e77 tensorflow GPU不能从jupyterhub / jupyter笔记本叫,为什么呢?

暂无
暂无

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

相关问题 甚至找不到libcublas.so.8.0 - libcublas.so.8.0 not found even it exists Tensorflow-ImportError:libcublas.so.8.0:无法打开共享对象文件:没有这样的文件或目录 - Tensorflow- ImportError: libcublas.so.8.0: cannot open shared object file: No such file or directory 完成更新和升级后,现在得到tensorflow ImportError:libcublas.so.8.0无法 - After doing update and upgrade, now get tensorflow ImportError: libcublas.so.8.0 cannot ImportError:libcublas.so.8.0:无法打开共享对象文件:没有这样的文件或目录(共享Linux) - ImportError: libcublas.so.8.0: cannot open shared object file: No such file or directory (Shared Linux) 使用CUDA8.0和cuDNN5.1安装tensorflow1.2时显示'ImportError:libcublas.so.9.0' - Install tensorflow1.2 with CUDA8.0 and cuDNN5.1 shows 'ImportError: libcublas.so.9.0' Tensorflow 2.3 和 libcublas.so.10 - Tensorflow 2.3 and libcublas.so.10 AWS Elastic beantalk上的tensorflow GPU-调用“ python” +“ sudo”的tf导入错误(libcublas.so.9.0错误) - tensorflow GPU on AWS elastic beanstalk - tf import error with calling “python” + “sudo” ( libcublas.so.9.0 error) 使用tensorflow-gpu后端导入Keras时出错(找不到libcublas.so.10.0) - Error in importing Keras with tensorflow-gpu backend (can't find libcublas.so.10.0) 仅在使用GUI时Tensorflow的“ImportError:libcublas.so.10.0” - “ImportError: libcublas.so.10.0” for Tensorflow ONLY when using GUI Ubuntu 中的 Tensorflow 2.3.0:libcublas.so.10:无法打开共享对象文件 - Tensorflow 2.3.0 in Ubuntu: libcublas.so.10: cannot open shared object file
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM