Pytorch in cudnn version inquiry

problem:

Disable or able cudnn, query version.

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 you'd 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 ()) 

For me,
7501
So,
sed -i "7501s/torch\.backends\.cudnn\.enabled/False/g" ${PYTORCH}/torch/nn/functional.py

 

Reproduced in: https: //www.cnblogs.com/wangyarui/p/11058346.html

Guess you like

Origin blog.csdn.net/weixin_34064653/article/details/93233025