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

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__)

posted @ 2021-08-29 15:40  麦克斯的园丁  阅读(71)  评论(0编辑  收藏  举报