I am trying to convert an mxnet Pre-trained model:

  
      
      Dropbox
  
  
    

model-MobileFaceNet-arcface-ms1m-refine-v1.zip 2

Shared with Dropbox


  
  
    
    
  
  


I am trying to convert a pretrained model from mxnet to pytorch, but it always seems to fail. So, first I download, unzip the model files and run:
mmconvert -sf mxnet -in model-symbol.json -iw model-0000.params -df pytorch -om pytorch.pth --inputShape 3,112,112 
and I get:
weight = self.weight_data.get(source_node.name + "_weight").asnumpy().transpose((1, 0))
AttributeError: 'NoneType' object has no attribute 'asnumpy'

which is the issue described here:

  
      github.com/microsoft/MMdnn
  
  
    
  
	  
  

  
    
      failed to convert MXnet model to TF 6
    

    
      
        opened 
        
          
        
        Jun 5, 2018
      
      

        
          closed 
        
          
        
        Jun 11, 2018
      
        

      
        
          
          IdeoG
        
      
    
  



  Platform (like ubuntu 16.04/win10):
Manjaro 17.1
Python version:
Python 3.6.5
Source framework with version (like Tensorflow 1.4.1 with GPU):
mxnet-latest with GPU
Destination framework with version (like...





  
  
    
    
  
  


so, I changed the line 408 in mxnet_parser.py to:
weight = self.weight_data.get("fc1_weight").asnumpy().transpose((1, 0))
Now, I run again:
mmconvert -sf mxnet -in model-symbol.json -iw model-0000.params -df pytorch -om pytorch.pth --inputShape 3,112,112 
and I get:
  File "pytorch.py", line 30, in __init__
    self.conv_2_dw_conv2d = self.__conv(2, name='conv_2_dw_conv2d', in_channels=64, out_channels=4096, kernel_size=(3, 3), stride=(1, 1), groups=64, bias=False)
  File "pytorch.py", line 335, in __conv
    layer.state_dict()['weight'].copy_(torch.from_numpy(__weights_dict[name]['weights']))
RuntimeError: The size of tensor a (4096) must match the size of tensor b (64) at non-singleton dimension 0

I am not sure what it is trying to tell me other than that there seems a size mismatch. I was wondering if anyone has encountered this and have a solution for this?
Also, I get a warning during the conversion:
 UserWarning: You created Module with Module(..., label_names=['softmax_label']) but input with name 'softmax_label' is not found in symbol.list_arguments(). Did you mean one of:
	data
  warnings.warn(msg)

Is this error something I can safely ignore? Sorry, I am VERY new to MXNET.