Open sathish331977 opened 1 year ago
You need to give " --grid --end2end " arguments when you are exporting.
here are my export args (included --grid and --end2end) !python export.py --weights bestmodelsforexport/yv701122023/best.pt \ --grid --end2end --topk-all 100 --iou-thres 0.65 --conf-thres 0.35 \ --img-size 640 640 --max-wh 600
the output looks like this now
You can extract batch_id, xmin, ymin, xmax, ymax, cls_id, and score (which 7 stands for) from this.
In latest code, the exported onnx model seems different. How can I map it? Following is my training code and export code:
python -m torch.distributed.launch --nproc_per_node 4 --master_port 9527 train.py --workers 8 --device 0,1,2,3 --sync-bn --batch-size 128 --data data/coco.yaml --img 640 640 --cfg cfg/training/yolov7.yaml --weights '' --name yolov7 --hyp data/hyp.scratch.p5.yaml
python export.py --weights runs/train/yolov7_box/weights/epoch_024.pt --grid --end2end --topk-all 100 --iou-thres 0.5 --conf-thres 0.35 --img-size 640 640 --max-wh 600
what execution env are you targetting? I export for TensorRT using:
python export.py --weights myweights.pt --grid --include-nms --conf-thres 0.01 --iou-thres 0.4 --img-size 640 640 --simplify
but it's using a TRT plugin so I don't think it'll work for other runtimes
@LukeAI When I try to run the command with the TRT nms, I get the following error:
And then exporting to tensorflow breaks with this error:
Have you or anyone else faced this error?
And then exporting to tensorflow breaks with this error:
you mean tensorrt right?
I guess your tensorrt install isn't present or up to date
Ah ok, didn't realise that I needed tensorrt to be installed as well, but I am trying to export the model to tensorflow.
However, I did notice that if I include the --max-wh
option with a value, it still throws an error when I try and convert to tensorflow.
After exporting a trained Yolov7 model to ONNX i see the following output . I am looking to extract bounding box , confidence score and the classes from the predictions. What is the correct mapping from output of onnx to bounding boxes, confidence score and classes. Number of classes trained are 9