pytorch-UNet icon indicating copy to clipboard operation
pytorch-UNet copied to clipboard

UnboundLocalError when training without validation set

Open JFHoelscher opened this issue 3 years ago • 0 comments

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

JFHoelscher avatar Jun 24 '21 21:06 JFHoelscher