Convert the yolox_l model to the onnx inference model, and report this error, how can I solve it? #1364
Unanswered
MiyazonoKaori137
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
(pytorch) C:\Users\xz1005\YOLOX-main>python export_onnx.py --output-name yolox_l.onnx -n yolox-l -c preModels/l_best_epoch_weights.pth
2022-06-06 20:36:31.964 | INFO | main:main:66 - args value: Namespace(output_name='yolox_l.onnx', input='images', output='output', opset=11, batch_size=1, dynamic=False, no_onnxsim=False, exp_file=None, experiment_name=None, name='yolox-l', ckpt='preModels/l_best_epoch_weights.pth', opts=[], decode_in_inference=False)
2022-06-06 20:36:32.856 | ERROR | main::135 - An error has been caught in function '', process 'MainProcess' (14972), thread 'MainThread' (14748):
Traceback (most recent call last):
File "C:\Users\xz1005\YOLOX-main\export_onnx.py", line 86, in main
model.load_state_dict(ckpt)
│ │ └ OrderedDict([('backbone.backbone.stem.conv.conv.weight', tensor([[[[ 0.0023, 0.0232, 0.0038],
│ │ [ 0.0459, -0.2495, ...
│ └ <function Module.load_state_dict at 0x00000245E0C22430>
└ YOLOX(
(backbone): YOLOPAFPN(
(backbone): CSPDarknet(
(stem): Focus(
(conv): BaseConv(
(conv): ...
File "D:\anaconda\envs\pytorch\lib\site-packages\torch\nn\modules\module.py", line 1497, in load_state_dict
raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for YOLOX:
size mismatch for head.cls_preds.0.weight: copying a param with shape torch.Size([10, 256, 1, 1]) from checkpoint, the shape in current model is torch.Size([80, 256, 1, 1]).
size mismatch for head.cls_preds.0.bias: copying a param with shape torch.Size([10]) from checkpoint, the shape in current model is torch.Size([80]).
size mismatch for head.cls_preds.1.weight: copying a param with shape torch.Size([10, 256, 1, 1]) from checkpoint, the shape in current model is torch.Size([80, 256, 1, 1]).
size mismatch for head.cls_preds.1.bias: copying a param with shape torch.Size([10]) from checkpoint, the shape in current model is torch.Size([80]).
size mismatch for head.cls_preds.2.weight: copying a param with shape torch.Size([10, 256, 1, 1]) from checkpoint, the shape in current model is torch.Size([80, 256, 1, 1]).
size mismatch for head.cls_preds.2.bias: copying a param with shape torch.Size([10]) from checkpoint, the shape in current model is torch.Size([80]).
Beta Was this translation helpful? Give feedback.
All reactions