From b365cafded7b2065500fc8b2fd0d53247997b1fc Mon Sep 17 00:00:00 2001 From: pinto0309 Date: Tue, 19 Jul 2022 11:34:51 +0900 Subject: [PATCH] Avoiding "local variable'i_val' referenced before assignment" --- IS-Net/train_valid_inference_main.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/IS-Net/train_valid_inference_main.py b/IS-Net/train_valid_inference_main.py index b72a8ce..0ee6600 100644 --- a/IS-Net/train_valid_inference_main.py +++ b/IS-Net/train_valid_inference_main.py @@ -198,6 +198,8 @@ def valid_gt_encoder(net, valid_dataloaders, valid_datasets, hypar, epoch=0): MAE = np.zeros((val_num)) val_cnt = 0.0 + i_val = None + for i_val, data_val in enumerate(valid_dataloader): # imidx_val, inputs_val, labels_val, shapes_val = data_val['imidx'], data_val['image'], data_val['label'], data_val['shape']