faedtodd / Tensorrt-Yolov3-tiny

darknet2onnx2tensorrt
26 stars 10 forks source link

error while converting from yolov3-tiny to onnx format #1

Open yzhangbx120 opened 5 years ago

yzhangbx120 commented 5 years ago

Hi, I found your github project is very helpful for me. I am also doing research on yolov3 with tensorRT. When I use your ped.onnx in the tensorRT code, it works well. However, when I try to convert my own yolov3-tiny model to onnx and then use it in tensorRT, the result is wrong and I think it may be caused by the maxpool layer. Could you share you darknet cfg file so that I can check whether there is something wrong with my cfg file. Thank you!

valentindbdg commented 5 years ago

Hi, I am interested as well, I think there is a format problem with my cfg file. I have the following error when trying to run "yolov3_to_onnx", I tried adding spaces between "conv" and "yolo" layers, but it did not work:

Traceback (most recent call last): File "yolov3_to_onnx.py", line 749, in main() File "yolov3_to_onnx.py", line 715, in main layer_configs = parser.parse_cfg_file(cfg_file_path) File "yolov3_to_onnx.py", line 92, in parse_cfg_file layer_dict, layer_name, remainder = self._next_layer(remainder) File "yolov3_to_onnx.py", line 133, in _next_layer layer_param_block, remainder = remainder.split('\n\n', 1) ValueError: need more than 1 value to unpack

zombie0117 commented 5 years ago

Hi, I am interested as well, I think there is a format problem with my cfg file. I have the following error when trying to run "yolov3_to_onnx", I tried adding spaces between "conv" and "yolo" layers, but it did not work:

Traceback (most recent call last): File "yolov3_to_onnx.py", line 749, in main() File "yolov3_to_onnx.py", line 715, in main layer_configs = parser.parse_cfg_file(cfg_file_path) File "yolov3_to_onnx.py", line 92, in parse_cfg_file layer_dict, layer_name, remainder = self._next_layer(remainder) File "yolov3_to_onnx.py", line 133, in _next_layer layer_param_block, remainder = remainder.split('\n\n', 1) ValueError: need more than 1 value to unpack

I met the same problem:(

zombie0117 commented 5 years ago

Hi, I am interested as well, I think there is a format problem with my cfg file. I have the following error when trying to run "yolov3_to_onnx", I tried adding spaces between "conv" and "yolo" layers, but it did not work:

Traceback (most recent call last): File "yolov3_to_onnx.py", line 749, in main() File "yolov3_to_onnx.py", line 715, in main layer_configs = parser.parse_cfg_file(cfg_file_path) File "yolov3_to_onnx.py", line 92, in parse_cfg_file layer_dict, layer_name, remainder = self._next_layer(remainder) File "yolov3_to_onnx.py", line 133, in _next_layer layer_param_block, remainder = remainder.split('\n\n', 1) ValueError: need more than 1 value to unpack

Adding a blank line could solve this problem. But when I converting the onnx model to trt model, I met a new problem: [TENSOR RT]ERROR: (Unnamed Layer* 38) [Concatenation]: all concat input tensors must have the same dimensions except on the concatenation axis.

barzan-hayati commented 5 years ago

Adding a blank line could solve this problem. But when I converting the onnx model to trt model, I met a new problem: [TENSOR RT]ERROR: (Unnamed Layer* 38) [Concatenation]: all concat input tensors must have the same dimensions except on the concatenation axis.

How you solved this problem?

barzan-hayati commented 5 years ago

Hi, I am interested as well, I think there is a format problem with my cfg file. I have the following error when trying to run "yolov3_to_onnx", I tried adding spaces between "conv" and "yolo" layers, but it did not work:

Traceback (most recent call last): File "yolov3_to_onnx.py", line 749, in main() File "yolov3_to_onnx.py", line 715, in main layer_configs = parser.parse_cfg_file(cfg_file_path) File "yolov3_to_onnx.py", line 92, in parse_cfg_file layer_dict, layer_name, remainder = self._next_layer(remainder) File "yolov3_to_onnx.py", line 133, in _next_layer layer_param_block, remainder = remainder.split('\n\n', 1) ValueError: need more than 1 value to unpack

Add a blank line o end of .cfg files . If you have any problem with bytes and str types, convert cfg address to bytes for resolving it:

instead of : layer_configs = parser.parse_cfg_file('Config.cfg') use: layer_configs = parser.parse_cfg_file(bytes("Config.cfg",encoding = 'utf-8'))#"./yolov3.cfg"

Also add line remainder = bytes.decode(remainder) after remainder = cfg_file.read()

ghost commented 4 years ago

Be sure that your .cfg file ends with 2 new lines. Thats how i solved my issue.