You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/08/24 15:29:06 UTC

[GitHub] ShownX opened a new issue #12334: Load pretrained model with new load_parameters() API

ShownX opened a new issue #12334: Load pretrained model with new load_parameters() API
URL: https://github.com/apache/incubator-mxnet/issues/12334
 
 
   ## Description
   Cannot load only convolutional layers with pre-trained model using ```load_parameters()``` API 
   
   ## Environment info (Required)
   Ubuntu 16.04
   mxnet-cu90 1.3.0b20180821
   
   ## Error Message:
   missing_parameters
   
   ## Minimum reproducible example
   ```
   from mxnet.gluon.model_zoo.vision import get_model
   
   # download the pretrained model with the path: model_path
   model = get_model('resnet101_v2')
   model.features.load_parameters(model_path)
   ```
   
   ## What have you tried to solve it?
   The reason of this issue is load_parameters called from ```features block```, in which name of parameters starts with numbers. But the pretrained model parameters starts with ```features```.
   The ```load_parameters``` cannot find the corresponding name in this case.
   
   One way to work around this issue is using the ```model.save_params()``` to save again and load using the API ```load_parameters```. However, the save_params() is deprecated.
   
   To prevent any problem with loading parameters, I propose this issue and hope the team can fix it.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services