Tianxiaomo / pytorch-YOLOv4

PyTorch ,ONNX and TensorRT implementation of YOLOv4
Apache License 2.0
4.46k stars 1.49k forks source link

darknet2pytorch supported for Yolo versions below 4 ? #536

Open sendeniz opened 2 years ago

sendeniz commented 2 years ago

Tianxiamo,

Amazing tool first of all. I tested your conversion method darknet2pytorch on both V4 and V1 and found out that V1 is not supported. Are there any plans to add support for versions below Yolo V4.

My test code resulted in the following output:

unknown type local
unknown type dropout
unknown type detection
unknown type local
unknown type dropout
---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
[<ipython-input-14-007ad6e147b5>](https://localhost:8080/#) in <module>()
      1 WEIGHTS = Darknet("yolov1.cfg", inference=True)
----> 2 WEIGHTS.load_weights("yolov1.weights")

2 frames
[/usr/local/lib/python3.7/dist-packages/torch/nn/modules/container.py](https://localhost:8080/#) in _get_abs_string_index(self, idx)
    187         idx = operator.index(idx)
    188         if not (-len(self) <= idx < len(self)):
--> 189             raise IndexError('index {} is out of range'.format(idx))
    190         if idx < 0:
    191             idx += len(self)

IndexError: index 30 is out of range

Please let me know, All the best.

lpkoh commented 1 year ago

@sendeniz did you have success with converting yolov4 at least? Am trying to convert yolov4-csp but its difficult