You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I guess my use of dataloader_num_workers=0 is causing the keys of the weights dictionary to be saved without the module. part, and since the trunk and embedder are wrapped in torch.nn.DataParallel, model_def.load_state_dict expects a dictionary with keys prepended with module..
My problem is solved by not using torch.nn.DataParallel, but I don't know if this is a behavior that could be fixed in PML or if I was just using it incorrectly.
I'm not sure what's causing this. I recommend using another library for the training loop, like Lightning, Ignite, Transformers, or Timm. You can also look at Open Metric Learning which I think has training loops that are compatible with many parts of this library.
This line is generating a
RuntimeError
:This happened after running this example, replacing
trainer.train(num_epochs=num_epochs)
by;And running
trainer.train(start_epoch, num_epochs=num_epochs)
a second time.Also note that I ran the example:
pip install pytorch-metric-learning[with-hooks]
because that downgraded my PML.dataloader_num_workers=0
.PyTorch version: 2.4.1+cu121
PyTorch Metric Learning version: 2.6.0
The text was updated successfully, but these errors were encountered: