检测tensorflow2和pytorch1.x的GPU环境是否配合正确

时间:2021-08-29 21:51:10   收藏:0   阅读:12
import tensorflow as tf
print(tf.__version__)
print(‘tf2‘, tf.config.list_physical_devices(‘GPU‘))
print(‘tf2‘, tf.test.is_gpu_available(), tf.__version__)	# 不再推荐

import torch
print(‘torch18‘, torch.cuda.is_available(), torch.__version__)

原文:https://www.cnblogs.com/hsiangyu-meng/p/15202724.html

评论(0)
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!