airctic / icevision

An Agnostic Computer Vision Framework - Pluggable to any Training Library: Fastai, Pytorch-Lightning with more to come
https://airctic.github.io/icevision/
Apache License 2.0
848 stars 150 forks source link

fastai warning - setting an attribute (loss) that also exists in the learner #356

Closed adamfarquhar closed 2 years ago

adamfarquhar commented 4 years ago

🐛 Bug

Describe the bug /opt/conda/lib/python3.7/site-packages/fastai2/callback/core.py:50: UserWarning: You are setting an attribute (loss) that also exists in the learner, so you're not setting it in the learner but in the callback. Use self.learn.loss otherwise. warn(f"You are setting an attribute ({name}) that also exists in the learner, so you're not setting it in the learner but in the callback. Use self.learn.{name} otherwise.")

To Reproduce Steps to reproduce the behavior:

  1. Happens on a fresh build of Mantisshrimp and call to: learn = faster_rcnn.fastai.learner(dls=[train_dl, valid_dl], model=model, metrics=metrics)
lgvaz commented 4 years ago

Yeah, although this warning can be annoying it's not a bug.

I know where this is coming from, I'll see if I can re-arrange things to stop this warning.

adamfarquhar commented 4 years ago

Thanks. This is the sort of thing that is disconcerting to the user. So, while not necessarily a bug, it causes doubt as to whether the underlying system is doing the right thing.

lgvaz commented 4 years ago

Can be related to #434. Need to check this again after updating the fastai version.

FraPochetti commented 2 years ago

Not relevant anymore