就用cpu训练网络
This commit is contained in:
parent
64935bf92f
commit
c1eb9d9528
12
PPO2/PPO.py
12
PPO2/PPO.py
@ -7,12 +7,12 @@ from torch.distributions import Categorical
|
||||
print("============================================================================================")
|
||||
# set device to cpu or cuda
|
||||
device = torch.device('cpu')
|
||||
if(torch.cuda.is_available()):
|
||||
device = torch.device('cuda:0')
|
||||
torch.cuda.empty_cache()
|
||||
print("Device set to : " + str(torch.cuda.get_device_name(device)))
|
||||
else:
|
||||
print("Device set to : cpu")
|
||||
# if(torch.cuda.is_available()):
|
||||
# device = torch.device('cuda:0')
|
||||
# torch.cuda.empty_cache()
|
||||
# print("Device set to : " + str(torch.cuda.get_device_name(device)))
|
||||
# else:
|
||||
# print("Device set to : cpu")
|
||||
print("============================================================================================")
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user