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 F1[i_test,:] = f1
MAE[i_test] = mae MAE[i_test] = mae
del ds_val, gt del ds_val, gt
gc.collect() gc.collect()
torch.cuda.empty_cache() torch.cuda.empty_cache()
# if(loss_val.data[0]>1): # if(loss_val.data[0]>1):
val_loss += loss_val.item()#data[0] val_loss += loss_val.item()#data[0]