Open mykcs opened 2 months ago
log
/Users/myk/anaconda3/envs/env-MedSAM-0422/bin/python /Users/myk/PyPjcts/MedSAM_lite-0424/train_mps-1.py Finetuning with pretrained weights lite_medsam.pth MedSAM Lite size: 9791300 wandb: Currently logged in as: mykcs (team-mykcs). Use `wandb login --relogin` to force relogin wandb: Tracking run with wandb version 0.16.6 wandb: Run data is saved locally in /Users/myk/PyPjcts/MedSAM_lite-0424/wandb/run-20240424_023431-1m08ghs8 wandb: Run `wandb offline` to turn off syncing. wandb: Syncing run run-0424-2 wandb: ⭐️ View project at https://wandb.ai/team-mykcs/MedSAM-lite wandb: 🚀 View run at https://wandb.ai/team-mykcs/MedSAM-lite/runs/1m08ghs8 0%| | 0/906 [00:00<?, ?it/s]Finetuning with pretrained weights lite_medsam.pth MedSAM Lite size: 9791300 Finetuning with pretrained weights lite_medsam.pth MedSAM Lite size: 9791300 Finetuning with pretrained weights lite_medsam.pth MedSAM Lite size: 9791300 Finetuning with pretrained weights lite_medsam.pth MedSAM Lite size: 9791300 Finetuning with pretrained weights lite_medsam.pth MedSAM Lite size: 9791300 Finetuning with pretrained weights lite_medsam.pth MedSAM Lite size: 9791300 Finetuning with pretrained weights lite_medsam.pth MedSAM Lite size: 9791300 Finetuning with pretrained weights lite_medsam.pth MedSAM Lite size: 9791300 Epoch 1 at 2024-04-24 02:47:22, loss: 0.0689: 100%|██████████| 906/906 [13:27<00:00, 1.12it/s] Traceback (most recent call last): File "/Users/myk/PyPjcts/MedSAM_lite-0424/train_mps-1.py", line 535, in <module> main() File "/Users/myk/PyPjcts/MedSAM_lite-0424/train_mps-1.py", line 515, in main "best_loss": best_loss, UnboundLocalError: local variable 'best_loss' referenced before assignment wandb: wandb: Run history: wandb: ce_loss_weight ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ wandb: epoch_loss[step] ▄▂▁▃▁▄▂█▁▄▁▂▂▆▃▄▅▂▃▃▂▃▃▄▃▁▁▂▂▃▂▂▇▆▄▄▄▄▅▂ wandb: iou_gt ▁ wandb: iou_loss_weight ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ wandb: l_ce ▂▂▂▁▁▁▂▂▁▃▁▁▂▃▃▁▃▁▃▂▂▁▁▄▁▁▁▂▂▁▁▂█▁▁▂▁▂▃▅ wandb: l_iou ▂▂▂▁▁▂▁▅▁▂▁▁▁▃▂▃▂▁▁▃▁▂▁▁▁▁▁▂▂▁▂▁█▂▂▁▃▂▃▁ wandb: l_seg ▄▂▁▃▁▄▂█▁▄▁▂▂▆▃▄▅▂▃▃▂▃▄▄▄▁▁▂▂▃▂▂▅▆▄▄▄▄▅▂ wandb: loss ▄▂▁▃▁▄▂█▁▄▁▂▂▆▃▄▅▂▃▃▂▃▃▄▃▁▁▂▂▃▂▂▇▆▄▄▄▄▅▂ wandb: loss.item() ▄▂▁▃▁▄▂█▁▄▁▂▂▆▃▄▅▂▃▃▂▃▃▄▃▁▁▂▂▃▂▂▇▆▄▄▄▄▅▂ wandb: mask_loss ▄▂▁▃▁▄▂█▁▄▁▂▂▆▃▄▅▂▃▃▂▃▄▄▄▁▁▂▂▃▂▂▆▆▄▄▄▄▅▂ wandb: seg_loss_weight ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ wandb: wandb: Run summary: wandb: ce_loss_weight 1.0 wandb: epoch_loss[step] 0.0689 wandb: iou_gt 0.84615 wandb: iou_loss_weight 1.0 wandb: l_ce 0.00062 wandb: l_iou 0.00346 wandb: l_seg 0.06482 wandb: loss 0.0689 wandb: loss.item() 0.0689 wandb: mask_loss 0.06544 wandb: seg_loss_weight 1.0 wandb: wandb: 🚀 View run run-0424-2 at: https://wandb.ai/team-mykcs/MedSAM-lite/runs/1m08ghs8 wandb: ⭐️ View project at: https://wandb.ai/team-mykcs/MedSAM-lite wandb: Synced 6 W&B file(s), 0 media file(s), 2 artifact file(s) and 0 other file(s) wandb: Find logs at: ./wandb/run-20240424_023431-1m08ghs8/logs 进程已结束,退出代码为 1
不是恶性bug,先搁置
mps-7.py 似乎解决了 推测原因: 把code放入 def main() 里面。 没有细究。
mps-7.py
def main()
log