jkjung-avt / tensorrt_demos

TensorRT MODNet, YOLOv4, YOLOv3, SSD, MTCNN, and GoogLeNet
https://jkjung-avt.github.io/
MIT License
1.75k stars 547 forks source link

layer not supported while convert cfg files #391

Closed grant7788 closed 3 years ago

grant7788 commented 3 years ago

I followed the guild here: https://jkjung-avt.github.io/setting-up-xavier-nx/ and error reported while converting weight / cfg files:

python3 yolo_to_onnx.py -m yolov4-416 Parsing DarkNet cfg file... Traceback (most recent call last): File "yolo_to_onnx.py", line 987, in main() File "yolo_to_onnx.py", line 916, in main layer_configs = parser.parse_cfg_file(cfg_file_path) File "yolo_to_onnx.py", line 97, in parse_cfg_file layer_dict, layer_name, remainder = self._next_layer(remainder) File "yolo_to_onnx.py", line 142, in _next_layer raise ValueError('%s layer not supported!' % layer_type) ValueError: layer not supported!

The platform is Jetson Xavier, JP4.4 Thanks.

jkjung-avt commented 3 years ago

My implementation only supports the following layer types in the DarkNet cfg file. Those are all the layers present in the original "yolov3-tiny", "yolov3", "yolov4-tiny", "yolov4", "yolov4-csp" and "yolov4-mish" models.

https://github.com/jkjung-avt/tensorrt_demos/blob/4b26770dca33cbe613f65e9b64ec3b9c912e2084/yolo/yolo_to_onnx.py#L909-L910

You encounter this issue because your model contains some layer(s) not in the supported-layers list. You might extend the source code to support those layers by yourself.