DDRNet.pytorch
DDRNet.pytorch copied to clipboard
UnboundLocalError on resume
UnboundLocalErrors occur on resume training. valid_loss and mean_IoU are obtained by code below:
in train.py:
if epoch % 10:
valid_loss, mean_IoU, IoU_array = validate(config, testloader, model, writer_dict)
That means valid_loss and mean_IoU are calculated on each 10 steps. However, they are printed on each step. Therefore, if you make RESUME: true in configs, and your previous model was NOT on epochs that are multiples of 10, errors will occur:
UnboundLocalError: local variable 'valid_loss' referenced before assignment.
UnboundLocalError: local variable 'mean_IoU' referenced before assignment.