1.如何查看自己Pycharm里面是否安装torch 以及自己torch cuda cudnn的版本
在pycharm的terminal终端直接输入下列语句
import torch
print(torch.__version__)
print(torch.version.cuda)
print(torch.backends.cudnn.version())
在pycharm里面查看自己的python环境的版本号
terminal终端:
import sys
print(sys.version)
python 3.7.4的环境
2. you might not have a CUDA gpu
如何判断当前的cuda是否可用
print(torch.cuda.is_available())
显示:表示当前的cuda是不可用的
UserWarning: CUDA initialization: CUDA driver initialization failed, you might not have a CUDA gpu. (Triggered internally at …\c10\cuda\CUDAFunctions.cpp:109.)
return torch._C._cuda_getDeviceCount() > 0
目前
3 .如何查看自己的torch 推荐使用的cuda cudnn
查询官网网址
https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html
4.UserWarning: Error checking compiler version for cl: ‘utf-8’ codec can’t decode byte 0xd3 in positi
定位到报错的那行代码:
然后在decode函数里面添加igonre
line.decode(encoding,"ignore")
然后再创建,就没有报错了。
5.UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xd3 in position 0: invalid continuation byte
UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xd3 in position 0: invalid continuation byte
#match = re.search(r'(\d+)\.(\d+)\.(\d+)', compiler_info.decode().strip())
加上 ' gbk'
match = re.search(r'(\d+)\.(\d+)\.(\d+)', compiler_info.decode(' gbk').strip())
6 查看当前cuda的位置,
但是这个打印的电脑的cuda不是python环境里面的cuda
cmd:
或者在cmd里面直接输入nvcc -V,也是查看windows的cuda版本的方法