GPU test code model training

Can deep learning test models be trained on GPUs?

import torch
print("torch.__version__        ",torch.__version__)
print("torch.version.cuda       ",torch.version.cuda)
print("torch.cuda.is_available  ",torch.cuda.is_available())
print('torch.cuda.get_device_name       '+ str(torch.cuda.get_device_name()))
print('torch.cuda.device_count  '+ str(torch.cuda.device_count()))
print("-------------------------------------------------------------")

import tensorflow as tf
import os
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "2"
version=tf.__version__ 
physical_devices=tf.config.list_physical_devices('GPU')
print("tf.__version__   ",version)
print("tf.config.list_physical_devices  ",len(physical_devices) != 0)
print("tf.test.is_built_with_cuda       ",tf.test.is_built_with_cuda())

Guess you like

Origin blog.csdn.net/weixin_46398647/article/details/125279682