median-research-group / LibMTL

A PyTorch Library for Multi-Task Learning
MIT License
1.95k stars 182 forks source link

Unable to save the trained model #23

Closed shubham166 closed 1 year ago

shubham166 commented 1 year ago

When I try to save the trained model i.e. full model using the following command -

torch.save(model, "<path>")

It throws this error

AttributeError: Can't pickle local object 'Trainer._prepare_model.<locals>.MTLmodel'

Baijiong-Lin commented 1 year ago

I suggest using LibMTL v1.1.6 which can save the best model automatically.

Baijiong-Lin commented 1 year ago

Closed as no further updates.