Open hlacikd opened 1 year ago
So I have been able to investigate this further and found out , it has to do with not normalizing image to 0..1 float (aka img = img / 255.0) which has its "legacy" flag in detection in your repo.
However i did not found this "flag" in train.py nor training settings cfg file. Could you please help?
I can workaround this issue in ONNX by passing image in 0.255 array, but when i use RKNN Toolkit2 Lite for inference on rockchip platform, i am unable to workaround it, since conversion to normalized image img = img / 255.0 is done internally .
My question is ... how to train edge yolo with "legacy" flag i.e img = img / 255.0
I have found out parameter "pixel_range" set to 255 in params , which i suppose can be set via dataset config. However I have found no use for it except in tensorrt which is not my case (i need onnx)
The first problem with not being able to generate onnx files is that there is a problem in the author's export.py file,In line 133 of this file,if this parameter which named as arge.rknn don't exist, then would a onnx file without name, so it isn't exist.In short,do this job: change it like this: onnx_file = file_name + "_for_rknn.onnx" if args.rknn else file_name+".onnx". I hope my answer will be helpful to you.
I tried it both with torch 2.0 and torch 1.3 , also messed with different versions of onnx, it all behave same
I am using model edgeyolo_tiny_lrelu trained on my custom dataset for 100epochs with 1 class.
Trained model (best.pth) works with detect.py , and is giving correct results for me.
However when i export it using following command line :
python export.py --onnx-only --weights /workspaces/rocm-ml/edgeyolo-output/train/edgeyolo_lp/best.pth
I have to comment out import # import tensorrt as trt in export.py , and i am getting following warnings :
ONNX model is created but its not usable ... does not output anything meaningfull ...
I am trying it using it via following commands in python notebook
then continuing just by reusing your code
and this is where it ends detections array is (0,7) instead of (1,7) which is what "detect.py" in this points returns. so no detections ...
code is taken from your postprocess function
I can provide notebook best.pth and onnx if you are interested