MPolaris / onnx2tflite

Tool for onnx->keras or onnx->tflite. Hope this tool can help you.
Apache License 2.0
526 stars 42 forks source link

Feature Request: NonMaxSuppression Layer #69

Open avatarrokuaskingquestions opened 4 months ago

avatarrokuaskingquestions commented 4 months ago

I'm using the tool on https://github.com/PINTO0309/PINTO_model_zoo/tree/main/420_Gold-YOLO-Hand and for the model I picked I get this error:

python3 converter.py --weights "./gold_yolo_n_hand_post_0303_0.4172_1x3x192x416.onnx" --outpath "./gold_time" --formats "tflite"
2024-07-03 11:32:05.715773: I tensorflow/core/util/port.cc:113] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
2024-07-03 11:32:05.717590: I external/local_tsl/tsl/cuda/cudart_stub.cc:31] Could not find cuda drivers on your machine, GPU will not be used.
2024-07-03 11:32:05.755410: E external/local_xla/xla/stream_executor/cuda/cuda_dnn.cc:9261] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered
2024-07-03 11:32:05.755455: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:607] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered
2024-07-03 11:32:05.756359: E external/local_xla/xla/stream_executor/cuda/cuda_blas.cc:1515] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
2024-07-03 11:32:05.763026: I external/local_tsl/tsl/cuda/cudart_stub.cc:31] Could not find cuda drivers on your machine, GPU will not be used.
2024-07-03 11:32:05.763224: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2024-07-03 11:32:06.474901: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
Checking 0/1...
...
Traceback (most recent call last):
  File "/home/avatarroku/Support/onnx2tflite/converter.py", line 140, in <module>
    run()
  File "/home/avatarroku/Support/onnx2tflite/converter.py", line 123, in run
    onnx_converter(
  File "/home/avatarroku/Support/onnx2tflite/converter.py", line 46, in onnx_converter
    keras_model = keras_builder(model_proto, native_groupconv)
  File "/home/avatarroku/Support/onnx2tflite/utils/builder.py", line 75, in keras_builder
    raise KeyError(f"{op_name} not implemented yet")
KeyError: 'NonMaxSuppression not implemented yet'

I'm down to debug if this is already implemented and it's just something wrong on my end, the error

MPolaris commented 4 months ago

onnx2tflite has not implement NonMaxSuppression op yet. there are currently no relevant plans, PR is very welcome.