-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to export my own mobilenet1.0 #982
Comments
Use net = gcv.model_zoo.get_model('mobilenet1.0', classes=5) instead. |
@hetong007 ,thank you for you reply, i try do it ,but error still happen, as follow: |
basically the idea is to use the same model definition in both training and test. So, let ask: how did you define the model when training (which generated the parameters that you want to load)? |
train_imagenet.txt how can i do it ? |
what is the exact command that generates this error message:
|
this is run export.py net = gcv.model_zoo.get_model('mobilenet1.0', pretrained=True,classes=5) |
be careful, remember to remove |
thank you very much, its ok. |
@hetong007 Sorry to bother again, my training and export are normal, but in the c program execution has been a segmentation error, other models call normal. error: |
@zhreshold can we have your help here |
without your c++ code it's hard to tell. @ou525 would you mind share the piece of |
classification.txt |
Can't find obvious problem so far. What if you use the pretrained model from gluoncv model zoo? |
using the pretrained model from gluoncv model zoo and the trained model by mxnet are ok, so i think the train script may have some prblem ,but i donot kown how to do? |
i train my own data using train_imagenet.py. but i donot how to export the model to mxnet.
i try:
import gluoncv as gcv
from gluoncv.utils import export_block
net = gcv.model_zoo.get_model('mobilenet1.0', pretrained=True)
net.load_parameters('./0.0877-imagenet-mobilenet1.0-88-best.params')
export_block('mobilenet1.0', net, preprocess=True, layout='HWC')
print('Done.')
But there was an error, how can I solve it?
error:
Traceback (most recent call last):
File "export_class.py", line 5, in
net.load_parameters('/home/ou/workplace/tmp_model/0.0877-imagenet-mobilenet1.0-88-best.params')
File "/usr/local/lib/python2.7/dist-packages/mxnet/gluon/block.py", line 410, in load_parameters
params[name]._load_init(loaded[name], ctx, cast_dtype=cast_dtype, dtype_source=dtype_source)
File "/usr/local/lib/python2.7/dist-packages/mxnet/gluon/parameter.py", line 279, in _load_init
self.name, str(self.shape), str(data.shape))
AssertionError: Failed loading Parameter 'mobilenet0_dense0_weight' from saved params: shape incompatible expected (1000, 1024) vs saved (5, 1024)
The text was updated successfully, but these errors were encountered: