1、安装
登录官网https://pytorch.org/,选择环境,就会给出相应的安装命令,很智能。
pip3 install https://download.pytorch.org/whl/cu80/torch-1.0.1.post2-cp35-cp35m-linux_x86_64.whl pip3 install torchvision
2、使用
(1)torch.backends.cudnn.benchmark = True
在程序刚开始加这条语句可以提升一点训练速度,没什么额外开销。
参考文献