欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 编程资源 > 编程问答 >内容正文

编程问答

DeepLearning:环境配置(cuda+cudnn)

发布时间:2025/3/20 编程问答 73 豆豆
生活随笔 收集整理的这篇文章主要介绍了 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可用

总结

以上是生活随笔为你收集整理的DeepLearning:环境配置(cuda+cudnn)的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。