tensorflow 报错 Could not load dynamic library 'cudart64_

这个错主要是tensorflow的版本对应的cuda版本不对导致的

例如我安装的tensorflow-gpu版本是2.1.0, cuda安装的是10.2结果报了

Could not load dynamic library 'cudart64_101.dll'

这个101表示对应的cuda版本应该是10.1,只要移除10.2版本的cuda,重新安装10.1版本的就行, cudnn也要一并修改到对应的版本

tensorflow的版本可以用 print(tf.__version__) 查询

测试代码

import tensorflow as tf
print(tf.__version__)
print(tf.__path__ ) 
print('GPU',tf.test.is_gpu_available())
print(tf.config.list_physical_devices('GPU'))
a = tf.constant(1)
b = tf.constant(1)
c = tf.add(a, b)
print(c)

打印结果:

GPU True

[PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU')]

tf.Tensor(2, shape=(), dtype=int32)

 

评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值