I tried adding --input argument then the issue bounced back to similar issue of size mismatch as mentioned in “Onnx_export.py outputs size mismatch for classification_headers.0.weight / bias errors”
But i tried to diff between labels.txt created by me and then by Pytorch, following is the output
“**diff data/face/labels.txt models/face/labels.txt **
0a1
> BACKGROUND”
As we can see there’s no difference in new line character in both the files.
current error after passing --input argument is this
"Traceback (most recent call last):
File “onnx_export.py”, line 86, in
net.load(args.input)
File “/jetson-inference/python/training/detection/ssd/vision/ssd/ssd.py”, line 135, in load
self.load_state_dict(torch.load(model, map_location=lambda storage, loc: storage))
File “/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py”, line 1045, in load_state_dict
self.class.name, “\n\t”.join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for SSD:
size mismatch for classification_headers.0.weight: copying a param with shape torch.Size([126, 512, 3, 3]) from checkpoint, the shape in current model is torch.Size([18, 512, 3, 3]).
size mismatch for classification_headers.0.bias: copying a param with shape torch.Size([126]) from checkpoint, the shape in current model is torch.Size([18]).
size mismatch for classification_headers.1.weight: copying a param with shape torch.Size([126, 1024, 3, 3]) from checkpoint, the shape in current model is torch.Size([18, 1024, 3, 3]).
size mismatch for classification_headers.1.bias: copying a param with shape torch.Size([126]) from checkpoint, the shape in current model is torch.Size([18]).
size mismatch for classification_headers.2.weight: copying a param with shape torch.Size([126, 512, 3, 3]) from checkpoint, the shape in current model is torch.Size([18, 512, 3, 3]).
size mismatch for classification_headers.2.bias: copying a param with shape torch.Size([126]) from checkpoint, the shape in current model is torch.Size([18]).
size mismatch for classification_headers.3.weight: copying a param with shape torch.Size([126, 256, 3, 3]) from checkpoint, the shape in current model is torch.Size([18, 256, 3, 3]).
size mismatch for classification_headers.3.bias: copying a param with shape torch.Size([126]) from checkpoint, the shape in current model is torch.Size([18]).
size mismatch for classification_headers.4.weight: copying a param with shape torch.Size([126, 256, 3, 3]) from checkpoint, the shape in current model is torch.Size([18, 256, 3, 3]).
size mismatch for classification_headers.4.bias: copying a param with shape torch.Size([126]) from checkpoint, the shape in current model is torch.Size([18]).
size mismatch for classification_headers.5.weight: copying a param with shape torch.Size([126, 256, 3, 3]) from checkpoint, the shape in current model is torch.Size([18, 256, 3, 3]).
size mismatch for classification_headers.5.bias: copying a param with shape torch.Size([126]) from checkpoint, the shape in current model is torch.Size([18]). "
Please Help.
Thanks & Regards,
Dipankar Sil