原先pytorch 是在官网下载的 pytorch1.4+cud9.2
但是在运行一个代码时加载的预训练参数模型是pytorch1.0版本的
因为版本不匹配所以在运行时报错
'AvgPool2d' object has no attribute 'divisor_override'
解决无果 只能降低自己的pytouch版本到1.0
卸载torch1.4+cud9.2 和 torchvision0.6.0+cud9.2
pip uninstall torch
pip uninstall torchvision
查询官网pytorch 匹配的cuda 只能是9.0 但是我本机是9.2
先安装
pytorch 各个包下载地址
https://download.pytorch.org/whl/cu92/torch_stable.html
离线下载
https://download.pytorch.org/whl/cu90/torch-1.0.0-cp36-cp36m-win_amd64.whl
cmd pip 安装
然后pip 安装对应的torchvision==0.2.1
然后因为pytorch1.0.0 对应的cuda 是9.0 本机是9.2 去测试是否可以用
import torch
#查看torch版本
# print(torch.__version__)
#查看torch对应version
# print(torch.version.cuda)
#查看cuda是否可用
# print(torch.cuda.is_available())