PL with Timm gives KeyError: 'model.model.conv1.0.bias when calling trainer.test #15268
Unanswered
MaxPolak97
asked this question in
Lightning Trainer API: Trainer, LightningModule, LightningDataModule
Replies: 1 comment
-
@MaxPolak97 Would you mind providing a minimal reproducible script and your env details to investigate this? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I'm using Timm for creating Resnet model. For training it works fine but when calling

trainer.test(light_model, datamodule, ckpt_path='best')
I get the following errorKeyError: 'model.model.conv1.0.bias'
. I have made three classes TransferLearningModel for loading any pre-trained model, DataModule for loading data and LightningClassifier model to do the actual training. So I checked how the model was defined and see that it goes wrong at .0 (see below). I didn't has this problem when using torchvision.models!However, when I use [0] instead of .0, it works.

Does anyone know how this problem occurred and can help me with solving this?
Beta Was this translation helpful? Give feedback.
All reactions