Open KingWu opened 2 years ago
Have you tried this Colab notebook? By far it's the easiest way to train
@dnth Yes. Tried Colab notebook. Just wanna to export other format. Open the notebook, and try to run the following script.
!cd yolov5-deepsparse-blogpost/yolov5-train/ && python export.py --weights zoo:cv/detection/yolov5-l/pytorch/ultralytics/coco/pruned_quant-aggressive_95 --include torchscript --img 640 --optimize
Found the error
Traceback (most recent call last):
File "export.py", line 715, in <module>
main(opt)
File "export.py", line 704, in main
run(**vars(opt))
File "/usr/local/lib/python3.7/dist-packages/torch/autograd/grad_mode.py", line 28, in decorate_context
return func(*args, **kwargs)
File "export.py", line 593, in run
model, extras = load_checkpoint(type_='ensemble', weights=weights, device=device) # load FP32 model
File "export.py", line 529, in load_checkpoint
state_dict = load_state_dict(model, state_dict, run_mode=not ensemble_type, exclude_anchors=exclude_anchors)
File "export.py", line 553, in load_state_dict
model.load_state_dict(state_dict, strict=not run_mode) # load
File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 1407, in load_state_dict
self.__class__.__name__, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for Model:
Unexpected key(s) in state_dict: "model.24.anchor_grid".
Any idea?
Ahh i see.. I think the export to torchscript is broken at the moment. You can ask in the Neural Magic slack group and I think there's better chance of getting answers there. If you'd like to use torchscript I suggest you use the original yolov5 repo and not the forked version by Neural Magic.
@dnth Where can i find the slack group?
I pull the yolov5 repo and download the coco dataset to ran the following command The recipe download from here
but throws the following errors