dmlc / gluon-cv

Gluon CV Toolkit
http://gluon-cv.mxnet.io
Apache License 2.0
5.84k stars 1.22k forks source link

How to save and load the SlowFast Fine tune model ? #1767

Closed barrybarrych closed 1 year ago

barrybarrych commented 1 year ago

I followed the script in https://gluon-cv.mxnet.io/build/examples_action_recognition/finetune_custom.html#id1, and It worked. and I successfully changed the model to slowfast_4x16_resnet50_custom, The training results look pretty good, so I want to save the model, I use torch.save() to store my model, but I encountered the following problems:

An error will occur when storing in .state_dict(): AttributeError: 'SlowFast' object has no attribute 'state_dict' It is possible to save the entire model, but when I want to load, .eval(), .to(device) will also have errors: AttributeError: 'dict' object has no attribute 'eval' or 'to' I would like to ask how can I solve it?Or how to save and load the finetuning model successfully Thanks!

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.