码迷,mamicode.com
首页 > 其他好文 > 详细

Pytorch中cudnn版本查询

时间:2019-06-20 14:13:13      阅读:409      评论:0      收藏:0      [点我收藏+]

标签:问题:   sed   env   dnn   http   import   fun   should   environ   

问题:

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版本查询

标签:问题:   sed   env   dnn   http   import   fun   should   environ   

原文地址:https://www.cnblogs.com/wangyarui/p/11058346.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!