rockchip-linux / rknn-toolkit

BSD 3-Clause "New" or "Revised" License
778 stars 174 forks source link

YOLOv7 conversion errors #299

Open mb-tapgest opened 1 year ago

mb-tapgest commented 1 year ago

Please help with pose estimation for rk3588

Pose

https://github.com/WongKinYiu/yolov7/tree/pose

W __init__: rknn-toolkit2 version: 1.4.0-22dcfef4
--> Loading model
W load_onnx: It is recommended onnx opset 12, but your onnx model opset is 11!
W load_onnx: Model converted from pytorch, 'opset_version' should be set 12 in torch.onnx.export for successful convert!
             More details can be found in examples/pytorch/resnet18_export_onnx
done
--> Building model
Analysing : 100%|███████████████████████████████████████████████| 510/510 [00:00<00:00, 1174.71it/s]
Quantizating : 100%|█████████████████████████████████████████████| 510/510 [00:03<00:00, 158.88it/s]
W build: The default input dtype of 'images' is changed from 'float32' to 'int8' in rknn model for performance!
                      Please take care of this change when deploy rknn model with Runtime API!
W build: The default output dtype of '2166' is changed from 'float32' to 'int8' in rknn model for performance!
                      Please take care of this change when deploy rknn model with Runtime API!
W build: The default output dtype of 'onnx::Slice_764' is changed from 'float32' to 'int8' in rknn model for performance!
                      Please take care of this change when deploy rknn model with Runtime API!
W build: The default output dtype of 'onnx::Slice_1128' is changed from 'float32' to 'int8' in rknn model for performance!
                      Please take care of this change when deploy rknn model with Runtime API!
W build: The default output dtype of 'onnx::Slice_1492' is changed from 'float32' to 'int8' in rknn model for performance!
                      Please take care of this change when deploy rknn model with Runtime API!
W build: The default output dtype of 'onnx::Slice_1856' is changed from 'float32' to 'int8' in rknn model for performance!
                      Please take care of this change when deploy rknn model with Runtime API!
Fatal: Meet unsupported operator: ScatterND(name="ScatterND_1511").

Origin:

https://github.com/WongKinYiu/yolov7

W __init__: rknn-toolkit2 version: 1.4.0-22dcfef4
--> Loading model
done
--> Building model
E build: The input 0 of NonMaxSuppression('NonMaxSuppression_373') need to be constant! It will cause the graph to be a dynamic graph!
W build: ===================== WARN(1) =====================
E rknn-toolkit2 version: 1.4.0-22dcfef4
E build: Catch exception when building RKNN model!
E build: Traceback (most recent call last):
E build:   File "rknn/api/rknn_base.py", line 1541, in rknn.api.rknn_base.RKNNBase.build
E build:   File "rknn/api/graph_optimizer.py", line 567, in rknn.api.graph_optimizer.GraphOptimizer.fold_constant
E build:   File "rknn/api/graph_optimizer.py", line 323, in rknn.api.graph_optimizer._dynamic_check
E build:   File "rknn/api/rknn_log.py", line 113, in rknn.api.rknn_log.RKNNLog.e
E build: ValueError: The input 0 of NonMaxSuppression('NonMaxSuppression_373') need to be constant! It will cause the graph to be a dynamic graph!
shanchao0906 commented 1 year ago

没解决吗?我也遇到这个问题了