I’ve been working on deploying a machine learning model (Pytorch) into production (iOS), however I’m having a few obstacles I need to hurdle. I tried following the steps here (https://github.com/longcw/pytorch2caffe/) to convert it to either caffe2 or ONNX (https://github.com/onnx/onnx-coreml), knowing the input_size is required to make a forward pass through the network.
I’m not sure if I’m either getting the error from Dimension mis-match or not properly calling enough arguments for my forward function. Any help is greatly appreciated!
EDIT #2:
you dont need to wrap your tensors in Variables anymore. Since 0.4 Variables and Tensors are merged. I recommend you take a loot at the migration guide to make your code cleaner and compatible with future releases
I think the problem is, you are using dropout with only one layer. You need at least 2 layers to apply dropout if you are using the LSTM class. You can check the documentation here. It says:
dropout – If non-zero, introduces a Dropout layer on the outputs of each LSTM layer except the last layer, with dropout probability equal to dropout. Default: 0
I’m using this git repo (https://github.com/taoxugit/AttnGAN) for cap_lens and the hidden variable. Their located inside AttnGAN/code/pretrain_DAMSM.py @line_65
however they were generated data (prepare_data) from the class AttnGAN/code/datasets.py @line_28