导入tensorflow:ImportError: libcublas.so.9.0 报错
作者:ZeroZone零域 时间:2023-07-07 11:44:46
错误:ImportError: libcublas.so.9.0: cannot open shared object file: No such file or directory
问题:找不到cuda9.0的版本。
出现该错误的主要原因:cuda未安装或者cuda的版本有问题
这个错误在安装tensorflow时经常会出现,但是在官方的常见问题中没有提到, 如果你使用下面的方法没有解决的话,可以在评论中留言。
对于tensorflow 1.7版本,只接受cuda 9.0(9.1也不可以!),和cudnn 7.0,所以如果你安装了cuda9.1和cudnn7.1或以上版本,那么你需要重新安装9.0和7.0版本。
安装完正确的版本后,确认你在你的~/.bashrc(或者~/.zshrc)文件中加入了下面环境变量
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-9.0/lib64
export PATH=$PATH:/usr/local/cuda-9.0/bin
export CUDA_HOME=$CUDA_HOME:/usr/local/cuda-9.0
如图所示:
之后重启电脑即可,将不会在提示ImportError: libcublas.so.9.0的错误。
如果你的cuda是8.0,那么你可以使用下面的指令将tensorflow的版本回滚到1.4版本,
pip install --upgrade tensorflow-gpu==1.4
来源:https://blog.csdn.net/ksws0292756/article/details/80034086
标签:导入,tensorflow,报错
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
关于Python turtle库使用时坐标的确定方法
2021-06-21 14:46:24
![](https://img.aspxhome.com/file/2023/1/70891_0s.jpg)
sqlserver2005 安装图解教程以及SQL 2005 SP3补丁安装图文教程
2024-01-15 12:05:13
![](https://img.aspxhome.com/file/2023/5/98015_0s.gif)
Python画图实现同一结点多个柱状图的示例
2021-04-21 23:26:04
![](https://img.aspxhome.com/file/2023/5/115695_0s.jpg)
Python中pycharm编辑器界面风格修改方法
2023-11-04 08:43:42
![](https://img.aspxhome.com/file/2023/3/75263_0s.jpg)
Java正则表达式API边界匹配
2023-07-03 19:36:18
详解用python写网络爬虫-爬取新浪微博评论
2021-09-30 22:23:11
shp2sqlserver 用法简析
2024-01-17 10:37:23
2020年10款优秀的Python第三方库,看看有你中意的吗?
2021-01-03 10:35:08
![](https://img.aspxhome.com/file/2023/8/103278_0s.png)
php for 循环语句使用方法详细说明
2023-11-17 21:43:21
Python爬虫中urllib3与urllib的区别是什么
2023-04-04 05:48:12
![](https://img.aspxhome.com/file/2023/6/112556_0s.png)
python批量从es取数据的方法(文档数超过10000)
2022-03-23 01:21:48
PHP实现网页内容html标签补全和过滤的方法小结【2种方法】
2023-09-06 22:28:26
MySQL5.7不停业务将传统复制变更为GTID复制的实例
2024-01-26 08:30:25
python去掉行尾的换行符方法
2021-10-24 02:36:22
Python读取二进制文件代码方法解析
2023-06-14 14:32:35
Python实现检测服务器是否可以ping通的2种方法
2023-06-07 20:18:14
![](https://img.aspxhome.com/file/2023/0/88920_0s.jpg)
chatGPT本地部署、运行和接口调用的详细步骤
2023-08-31 03:46:31
![](https://img.aspxhome.com/file/2023/9/104959_0s.jpg)
基于Python实现简单的汉字拼音转换工具
2022-10-03 10:42:35
利用Python写个摸鱼监控进程
2022-11-04 10:40:45
![](https://img.aspxhome.com/file/2023/3/115133_0s.jpg)
Python 如何求矩阵的逆
2021-07-22 23:28:43
![](https://img.aspxhome.com/file/2023/7/72807_0s.jpg)