josephevans opened a new issue #19580:
URL: https://github.com/apache/incubator-mxnet/issues/19580


   ## Description
   When using MXNet master branch, some gluon model zoo CV models no longer 
load when setting pretrained=True. From discussing with @leezu, it seems naming 
conventions may have changed between MXNet versions.
   
   The following CV models are no longer working in master:
   
   * vgg11
   * vgg13
   * vgg11_bn
   * vgg13_bn
   * alexnet
   * inceptionv3
   * densenet121
   * densenet161
   * densenet169
   * densenet201
   * squeezenet1.0
   * squeezenet1.1
   * mobilenet1.0
   * mobilenet0.75
   * mobilenet0.5
   * mobilenet0.25
   
   All the other models tested in tests/python/unittest/test_gluon_model_zoo.py 
work fine (see 
https://github.com/apache/incubator-mxnet/blob/master/tests/python/unittest/test_gluon_model_zoo.py#L31-L39).
   
   ## To Reproduce
   ```
   import mxnet as mx
   
   mx.gluon.model_zoo.vision.get_model('mobilenet1.0', pretrained=True, 
root=".")
   ```
   
   ### Error Message
   ```
   [23:48:38] ../src/storage/storage.cc:199: Using Pooled (Naive) 
StorageManager for CPU
   Traceback (most recent call last):
     File "./issue.py", line 5, in <module>
       mx.gluon.model_zoo.vision.get_model('mobilenet1.0', pretrained=True, 
root=".")
     File "/home/ubuntu/mxnet/python/mxnet/gluon/model_zoo/vision/__init__.py", 
line 152, in get_model
       return models[name](**kwargs)
     File 
"/home/ubuntu/mxnet/python/mxnet/gluon/model_zoo/vision/mobilenet.py", line 
260, in mobilenet1_0
       return get_mobilenet(1.0, **kwargs)
     File 
"/home/ubuntu/mxnet/python/mxnet/gluon/model_zoo/vision/mobilenet.py", line 
212, in get_mobilenet
       get_model_file('mobilenet%s' % version_suffix, root=root), ctx=ctx)
     File "/home/ubuntu/mxnet/python/mxnet/gluon/block.py", line 431, in 
load_parameters
       self.load_dict(full_dict, ctx, allow_missing, ignore_extra, cast_dtype, 
dtype_source)
     File "/home/ubuntu/mxnet/python/mxnet/gluon/block.py", line 476, in 
load_dict
       name, error_str, _brief_print_list(loaded.keys()))
   AssertionError: Parameter 'features.0.weight' is missing in 'file: 
./mobilenet1.0-6b8c5106.params', which contains parameters: 
'batchnorm7_running_var', 'batchnorm10_beta', 'batchnorm26_running_mean', ..., 
'batchnorm26_beta', 'batchnorm2_beta', 'batchnorm15_gamma', 'conv25_weight'. 
Set allow_missing=True to ignore missing parameters.
   ```
   
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to