Save params error on the pikachu gluoncv example

Hi,
I’m meeting another error on the pikachu SSD finetuning example: https://gluon-cv.mxnet.io/build/examples_detection/finetune_detection.html#sphx-glr-build-examples-detection-finetune-detection-py

I fine tune the network as explained in the tuto (on a different dataset), yet, when it comes to net.save_parameters('somemodelname.params') I receive the following error:
RuntimeError: Parameter 'ssd8_mobilenet0_conv0_weight' has not been initialized. Note that you should initialize parameters and create Trainer with Block.collect_params() instead of Block.params because the later does not include Parameters of nested child Blocks

How can I fix that? Training seems successful btw (correctly prints losses and things and finishes)

changing this

net = gcv.model_zoo.get_model('ssd_512_mobilenet1.0_custom', classes=classes,
    pretrained_base=False, transfer='voc') 

to this

net = gcv.model_zoo.get_model('ssd_512_mobilenet1.0_custom', classes=classes,
    pretrained_base=True, transfer='voc')

removed the error

These look the same to me > _ < Although it might just be super early.

haha indeed they were :slight_smile: that was a mistake, I just edited it. My change is to use pretrained_base=True

1 Like