Skip to content

Unable to retrain an ssd-mobilenet model using voc format input #820

@G4GUO

Description

@G4GUO

I have successfully managed to re-train the fruit example in the tutorial but when I try to retrain the picture example with voc files
the training runs OK but when I then try to convert the model using onnx_export.py I get the following errors.

RuntimeError: Error(s) in loading state_dict for SSD:
size mismatch for classification_headers.0.weight: copying a param with shape torch.Size([30, 512, 3, 3]) from checkpoint, the shape in current model is torch.Size([24, 512, 3, 3]).
size mismatch for classification_headers.0.bias: copying a param with shape torch.Size([30]) from checkpoint, the shape in current model is torch.Size([24]).

This seems to indicate that the mobilenet model I have trained is not the same layer format as the mobilnet model the utility is trying to generate. I have run this example in a docker container and outside a docker container and get the same results. I am not sure what the problem is due to. When I do the training I am using the correct mobilenet base model so I would expect it to generate the new model in the same format, which I would then expect to be in the required format for the onnx utility.
Any help would be appreciated.

  • Charles

P.S I have asked this question in the NVIDIA developers forum as well but I thought this might be a better place to ask it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions