I tried converting a pytorch model into deployment (ios) so I’m focused on converting a model to either cafffe or Onnx (TypeError: forward() missing 2 required positional arguments: 'cap_lens' and 'hidden' 9). My initial error was only having 'one layer" inside an lstm yet I encountered another problem.
I tried implementing two layers (nlayers=2) by instantiating a new rnn object called text_encoder

text_encoder.png707×41 5.27 KB

Yet I’m given an error of some key(s) inside the state_dict is missing. This error doesn’t occur for having one layer yet but I do get an error during the conversion (TypeError: forward() missing 2 required positional arguments: 'cap_lens' and 'hidden' 9)
I’m not sure if this is happening because the model I loaded only had one layer or another problem. How can I recover missing key’s while adding a new layer? Or is that impossible?

loading.png1072×367 56.7 KB