Before I trained a model with Timm my application worked perfectly when reading an older model. However when I implemented a new model using convnext and the library Timm I got this error:
AttributeError: Custom classes or functions exported with your `Learner` are not available in the namespace currently.
Please re-declare or import them before calling `load_learner`:
Can't get attribute 'TimmBody' on <module 'fastai.vision.learner' from '/home/app/lib/python3.9/site-packages/fastai/vision/learner.py'>
I already put Timm in my requirements.txt file at the start and run pip -r requirements.txt --no-cache with a new python environment that uses the 3.9 version. I also import Timm in the root of the application and later I read from the model .pkl