TIO-IKIM / CellViT

CellViT: Vision Transformers for Precise Cell Segmentation and Classification
https://doi.org/10.1016/j.media.2024.103143
Other
189 stars 27 forks source link

eval_every must equal to 1 #32

Closed windygoo closed 8 months ago

windygoo commented 8 months ago

I want to eval model performance every 5 epochs to reduce training time, I find the eval_every variable in the config.yaml is used to control this event. However, if I change it from 1 to 5, the following error raises:

Error: UnboundLocalError: local variable 'val_scalar_metrics' referenced before assignment

This error comes from: self.scheduler.step(float(val_scalar_metrics["Loss/Validation"])) in the base_trainer.py

windygoo commented 8 months ago

I turn to enable self.scheduler.step() after 50 epochs to speed up training.