How to transfer res2net from pytorch to mxnet?

Hello!

I use the official Res2Net implementation in Pytorch. However, I need to transfer it to mxnet. There are no trained weights for mxnet, so I want to transfer them from Pytorch.

I’m trying to do it via onnx (according to the instructions on the mxnet site). However, during the execution of one_maxnet.import_model I get the KeyError error: ‘conv 1.weight’.

Code:

batch_size = 1
x = torch.randn(batch_size, 3, 256, 128, requires_grad=True)

torch.onnx.export(model_base, 
              x, 
              './models_weights/res2net.onnx', 
              export_params=True, 
              opset_version=10,   
              do_constant_folding=True,  
              input_names = ['input'], 
              output_names = ['output'], 
              dynamic_axes={'input' : {0 : 'batch_size'}, 
                            'output' : {0 : 'batch_size'}},
             verbose = True)

sym, arg_params, aux_params = onnx_mxnet.import_model('./models_weights/res2net.onnx')

Please help with this error.

Thank you in advance!