How to save the torch model in pytorch?

Hi
How to save the torch model in pytorch?
I have successfully loaded the torch model in pytorch, and it can perform test correctly as well.

but how to save the model in pytorch format? I would like to load the model in pytorch without using any legacy layers.
I got error an error when saving the model AttributeError: ‘Sequential’ object has no attribute ‘state_dict’

Thank you

Where is your code …?

I use this to load model
model = load_lua(‘model.net’)

torch.save(model.state_dict(), PATH)
and use this to save model

1 Like

we do not support converting legacy models to new models. so there is no way to do this.

1 Like