torch tensorflow测试GPU配置是否成功以及相关问题

目录

torch

import torch

'''
配置成功会输出一个device ID:0
未配置成功会输出False
'''
torch.cuda.current_device()
'''
或者,返回True or False
'''
print(torch.cuda.is_available())

问题

Torch not compiled with CUDA enabled:
pytorch对应的cudatoolkit版本不对

tensorflow-gpu

import tensorflow as tf

'''
配置成功会出现True
未成功出现False
'''
print('GPU',tf.test.is_gpu_available())

问题

找不到cuda相关dll类型,比如cublas64_11.dll:
pytorch对应的cudatoolkit版本不对
安装cudatoolkit,比如10.2的

conda install cudatoolkit=10.2

参考

Pytorch错误:Torch not compiled with CUDA enabled:
https://blog.csdn.net/qq_40329272/article/details/105727722
win10下TensorFlow-GPU安装(GTX1660+CUDA10+CUDNN7.4):
https://blog.csdn.net/weixin_38314865/article/details/101562436

Original: https://blog.csdn.net/qq_41102371/article/details/121340892
Author: 诺有缸的高飞鸟
Title: torch tensorflow测试GPU配置是否成功以及相关问题

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/514306/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

亲爱的 Coder【最近整理,可免费获取】👉 最新必读书单  | 👏 面试题下载  | 🌎 免费的AI知识星球