摘要: cudnn为网络每一卷积层选最优实现方法,加速网络训练。 设置如下: torch.backends.cudnn.benchmark = True 加速条件如下: 1. 输入数据在训练过程中一般不变化。 2. 数据量较大,并可以同时加载到GPU内存中。 3. 训练次数比较多。 阅读全文
posted @ 2023-10-09 23:36 Dsp Tian 阅读(37) 评论(0) 推荐(0) 编辑
摘要: 安装完pytorch、cuda和cudnn之后,可以先判断是否可用。 import torch print('CUDA版本:',torch.version.cuda) print('Pytorch版本:',torch.__version__) print('显卡是否可用:','可用' if(torc 阅读全文
posted @ 2023-10-09 21:19 Dsp Tian 阅读(292) 评论(0) 推荐(0) 编辑