dmlc / dmlc/mxnet-model-gallery

RuntimeError: prob_label is not presented

Open
#19 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
266
Forks
71
PR merge metrics
No merged PRs in 30d

Description

#Hi,

I got an **RuntimeError: prob_label is not presented** when I run [http://mxnet.io/tutorials/python/predict_imagenet.html](Example : Predict with pretrained model) with pretrained model [https://github.com/dmlc/mxnet-model-gallery/blob/master/imagenet-1k-nin.md](NIN).

first , I load pretrained model follow the tutorial:
```python
import mxnet as mx
sym, arg_params, aux_params = mx.model.load_checkpoint('nin', 0)
```

I found 'prob_label' in sym.list_arguments() but it is not exists in 'arg_params'

when I create a model for this model on GPU 0 like this:
```python
mod = mx.mod.Module(symbol=sym, context=mx.gpu())
mod.bind(for_training=False, data_shapes=[('data', (1,3,224,224))])
mod.set_params(arg_params, aux_params)
```
the error occurs at `mod.set_params(arg_params, aux_params)` ,
```
Traceback (most recent call last):
File "loadmodel.py", line 7, in
mod.set_params(arg_params, aux_params,allow_missing=False)
File "/usr/local/lib/python2.7/dist-packages/mxnet-0.7.0-py2.7.egg/mxnet/module/base_module.py", line 483, in set_params
allow_missing=allow_missing, force_init=force_init)
File "/usr/local/lib/python2.7/dist-packages/mxnet-0.7.0-py2.7.egg/mxnet/module/module.py", line 198, in init_params
_impl(name, arr, arg_params)
File "/usr/local/lib/python2.7/dist-packages/mxnet-0.7.0-py2.7.egg/mxnet/module/module.py", line 191, in _impl
raise RuntimeError("%s is not presented" % name)
RuntimeError: prob_label is not presented

how can I fix this?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.