Skip to content

Commit 42cf057

Browse files
Update train.py
if torch.cuda.is_available: change to if torch.cuda.is_available(): because torch.cuda.is_available is a function, need '()', it is just a clerical error
1 parent 4cb49ae commit 42cf057

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

train.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ def save_network(network, epoch_label):
263263
save_filename = 'net_%s.pth'% epoch_label
264264
save_path = os.path.join('./model',name,save_filename)
265265
torch.save(network.cpu().state_dict(), save_path)
266-
if torch.cuda.is_available:
266+
if torch.cuda.is_available():
267267
network.cuda(gpu_ids[0])
268268

269269

0 commit comments

Comments
 (0)