简体   繁体   English

具有多个 cuda 版本的系统上的 tensorflow-gpu 安装问题

[英]tensorflow-gpu installation problem on system with multiple cuda versions

I installed tensorflow-gpu using我安装了 tensorflow-gpu 使用

sudo pip3 install tensorflow-gpu on python3.6 sudo pip3 install tensorflow-gpu在 python3.6 上sudo pip3 install tensorflow-gpu

The system I am using has both cuda 10 and cuda 9.0 installed on it.我使用的系统上安装了 cuda 10 和 cuda 9.0。

I have exported the cuda 9.0 paths, but import tensorflow still gives me我已经导出了 cuda 9.0 路径,但import tensorflow仍然给我

ImportError: libcublas.so.10.0: cannot open shared object file: No such file or directory

Is there any way I can force tensorflow to use cuda 9.0 because the default pre-compiled tensorflow using pip only works with cuda 9.0 according to the official documentation.有什么办法可以强制 tensorflow 使用 cuda 9.0,因为根据官方文档,使用 pip 的默认预编译 tensorflow 仅适用于 cuda 9.0。

Additional info:附加信息:

  1. I do not want to use a virtualenv because I am installing tensorflow for the entire system so that all users can use it.我不想使用 virtualenv,因为我正在为整个系统安装 tensorflow,以便所有用户都可以使用它。

  2. I have in the past installed tensorflow after compiling with bazel, but only I was able to use it.我过去在用 bazel 编译后安装了 tensorflow,但只有我能够使用它。 Other users could not, even after exporting the cuda paths to their profiles.其他用户不能,即使在将 cuda 路径导出到他们的配置文件之后。 So, I am trying to make the default pip installation work this time.所以,这次我试图让默认的 pip 安装工作。 I have uninstalled the previous tensorflow installation successfully.我已经成功卸载了之前的 tensorflow 安装。

尝试安装不同版本的 tensorflow,如 1.11.0,即支持 cuda 9 的版本

To import tensorflow your environment should have numpy.So check numpy is installed or not using import numpy?要导入 tensorflow,你的环境应该有 numpy。所以检查 numpy 是否安装或不使用 import numpy? If it is intalled then install tensorflow and tensorflow-gpu using following commands.如果已安装,则使用以下命令安装 tensorflow 和 tensorflow-gpu。

activate yourEnvName
conda install tensorflow
conda install tensorflow-gpu

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

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