网上介绍的apex-amp导入方式:不要pip install apex
使用
$ git clone https://github.com/NVIDIA/apex
$ cd apex
$ pip install -v --no-cache-dir --global-option="–pyprof" --global-option="–cpp_ext" --global-option="–cuda_ext" ./
安装,但是我安装完之后在apex文件夹可以
/>> python3
/>> from apex import amp
在apex的父文件夹可以
/>> python3
/>> import apex
但是不可以
/>> from apex import amp
首先通过nvcc --version查看自己的nvcc版本
我的是Cuda compilation tools, release 10.1, V10.1.243
再通过
/>> python3
/>> import torch
/>> torch.version.cuda
查看自己的cuda版本,我的是10.2
pytorch是1.6.0
首先pytorch和cuda版本一定要一致
其次pytorch cuda版本一定要和nvcc一致
2080ti显卡可以统一到10.0
重装pytorch.cuda