Pytorch中cudnn版本查询

Posted wangyarui

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Pytorch中cudnn版本查询相关的知识,希望对你有一定的参考价值。

问题:

Disable or able cudnn,查询版本。

Disable cudnn for batch_norm: (See: @Microsoft / human-pose-estimation.pytorch#installation)

# PYTORCH=/path/to/pytorch
# for pytorch v0.4.0
sed -i "1194s/torch\.backends\.cudnn\.enabled/False/g" $PYTORCH/torch/nn/functional.py
# for pytorch v0.4.1
sed -i "1254s/torch\.backends\.cudnn\.enabled/False/g" $PYTORCH/torch/nn/functional.py

# Note that instructions like # PYTORCH=/path/to/pytorch indicate that you should pick 
# a path where youd like to have pytorch installed and then set an environment
# variable (PYTORCH in this case) accordingly.

For other pytorch version

import torch
print(torch.backends.cudnn.version())

对我来说
7501
所以,
sed -i "7501s/torch\.backends\.cudnn\.enabled/False/g" $PYTORCH/torch/nn/functional.py

 

以上是关于Pytorch中cudnn版本查询的主要内容,如果未能解决你的问题,请参考以下文章