pytorch-UNet
pytorch-UNet copied to clipboard
UnboundLocalError when training without validation set
File ".../unet/model.py", line 212, in fit_dataset **val_logs, **train_logs} UnboundLocalError: local variable 'val_logs' referenced before assignment
The val_dataset
argument to fit_dataset
is optional. However, if none is provided, val_logs
is not assigned. Anyway it is referenced, leading to this error.
Suggested fix: Add val_logs = {}
to the else
clause of if val_dataset is not None:
in fit_dataset