-
DescriptionI was trying to train maskrcnn using mxnet and gluoncv under cpu with the script "train_mask_rcnn.py" provided by gluoncv (see https://cv.gluon.ai/build/examples_instance/train_mask_rcnn_coco.html). The train script does not raise any error, however, when I tried to load my pretrained model and test an image, I got this error. I don't know what's happening. Error MessageTraceback (most recent call last): To ReproduceThis is "pre_mask_rcnn.py": net = gluon.SymbolBlock.imports('./mask_rcnn_resnet50_v1b_coco_0000_0.0000-symbol.json', ['data0', 'data1', 'data2'], './mask_rcnn_resnet50_v1b_coco_0000_0.0000-0000.params', ctx=mx.cpu()) # this is where the error happens in train_mask_rcnn.py, I used the following two lines to save the model and parameters. Steps to reproduceRun the "pre_mask_rcnn.py" in pycharm What have you tried to solve it?Load from model_zooI tried to use another way to load model from model_zoo with my pretrained parameters: param = "./mask_rcnn_resnet50_v1b_coco_0000_0.0000-0000.params" but I got another error in "net.load_parameters(param.strip())" It seems that the name of parameters in the loaded model do not have prefix ""maskrcnn0_resnetv1b_", which appears in my saved parameters. I went back to "train_mask_rcnn.py" and found an argument "save_prefix", but it affects the file name of ".param" and ".json" instead of the parameters themselves. By the way, in "pre_mask_rcnn.py", if I change into then I got another error: Environment----------Python Info---------- |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Welcome to Apache MXNet (incubating)! We are on a mission to democratize AI, and we are glad that you are contributing to it by opening this issue. |
Beta Was this translation helpful? Give feedback.
-
To use with imports interface, you need to use block.export to save both the graph and the parameters. |
Beta Was this translation helpful? Give feedback.
To use with imports interface, you need to use block.export to save both the graph and the parameters.