-
Notifications
You must be signed in to change notification settings - Fork 347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pretrained_weights example will not work with the timm model #1643
Comments
I think the wording may be misleading, but it's not suggesting you use a timm model with PyTorch Lightning. It's simply suggesting that if you have your own custom training framework (not PL) you can load the pretrained weights into a base nn.Module. |
It would be nice if we could figure out #996. It doesn't help that |
Could this be a possible solution? https://stackoverflow.com/a/59042066
Instead, load_state_dict should be called without assigning it to the model variable.
|
Seems like it might be fixed in #1503? |
I'm getting a similar error with the following snippet that uses the SemanticSegmentationTask. from pytorch_lightning import Trainer
from torchgeo.datamodules import InriaAerialImageLabelingDataModule
from torchgeo.trainers import SemanticSegmentationTask
datamodule = InriaAerialImageLabelingDataModule(root_dir="./inria", batch_size=64, num_workers=6)
task = SemanticSegmentationTask(model="unet", backbone="resnet18", lr=0.1)
trainer = Trainer(default_root_dir="./unet_trainer", max_epochs=1)
trainer.fit(model=task, datamodule=datamodule)
the I can't find an example of semantic segmentation so I tried to follow the structure of the classification task example in the documentation, but use a backbone instead of specifying weights since there are no pretrained semantic segmentation weights. |
Could you retry with |
that fixed it thanks @calebrob6 |
I think this was just a user mistake, we can close this issue. |
Issue
These docs describe creation of a timm model if you do not want to use
ClassificationTask
, but if you replace the final cell:You will get the error:
Fix
Not sure yet!
The text was updated successfully, but these errors were encountered: