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__)
2023-11-16 17:55:16
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__)