Update train_valid_inference_main.py

the variable ds_val was accessed after deletion (or before assignment)
This commit is contained in:
juraev 2022-09-18 12:38:19 +08:00 committed by GitHub
parent 7df2a36362
commit 00bbb38776
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -493,9 +493,9 @@ def valid(net, valid_dataloaders, valid_datasets, hypar, epoch=0):
F1[i_test,:] = f1
MAE[i_test] = mae
del ds_val, gt
gc.collect()
torch.cuda.empty_cache()
del ds_val, gt
gc.collect()
torch.cuda.empty_cache()
# if(loss_val.data[0]>1):
val_loss += loss_val.item()#data[0]