DeepLearning:环境配置(cuda+cudnn)

1.参考链接:
cudnn cuda安装:参考我的另一篇文章
https://blog.csdn.net/weixin_44322778/article/details/108703099
原文链接:https://blog.csdn.net/weixin_42359147/article/details/80622306
2.error
安装完cuda和cudnn之后测试样例:
C:\ProgramData\NVIDIA Corporation\CUDA Samples\v10.0\5_Simulations\nbody
1.提示“error MSB8036: 找不到 Windows SDK 版本10.0.15063.0。请安装所需的版本的 Windows SDK 或者在项目属性页中或通过右键单击解决方案并选择“重定解决方案目标”

解决方案:项目箭头→“重定解决方案目标”重新编译即可实现下图展示

在这里插入图片描述
3.代码测试:


import tensorflow as tf
hello = tf.constant('hello')
sess = tf.Session()

print(sess.run(hello))
sess.close()
print(tf.__version__)


a = tf.test.is_built_with_cuda()  # 判断CUDA是否可以用
b = tf.test.is_gpu_available(
    cuda_only=False,
    min_cuda_compute_capability=None
)                                  # 判断GPU是否可以用

print(a)
print(b)

```![在这里插入图片描述](https://img-blog.csdnimg.cn/6123de547fd241939ca4d3dae3de8b52.png?x-oss-process=image/watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBA5pe26Ze05LmL6YeM,size_20,color_FFFFFF,t_70,g_se,x_16)

输出结果是:
True
True
代表CUDA和GPU可用
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

时间之里

好东西就应该拿出来大家共享

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值