pytorch-YOLOv4 icon indicating copy to clipboard operation
pytorch-YOLOv4 copied to clipboard

Is the class Yolov4 in models.py and class Darknet in darknet2pytorch.py the same model?

Open sykimm opened this issue 4 years ago • 10 comments

I'm curious why do i have to train with Yolov4 instance model in train.py and inference with Darknet instance model. Are they same models??

Oh, I think I have to use .weights file which is the darknet format in demo.py. Then, how could I use .pth file in demo.py???

sykimm avatar May 26 '20 08:05 sykimm

@Tianxiaomo models.py的Yolov4和darknet2pytorch.py的Darknet 模型不一致

myl980 avatar May 30 '20 06:05 myl980

I'm curious about it too. Maybe we can create a Yolov4 instance model to infer, instand of a Darknet instance in demo.py? I've already tried it, unfortunately, I failed to implement this idea. if you can implement this idea, please let me kown. Thanks

oreo-lp avatar May 31 '20 01:05 oreo-lp

您好,我昨天测试了,不能转换的原因是cfg与模型不配对,是我的原因,将cfg改正确后是可以转换的。

---Original--- From: "oreo-lp"<[email protected]> Date: Sun, May 31, 2020 09:22 AM To: "Tianxiaomo/pytorch-YOLOv4"<[email protected]>; Cc: "Comment"<[email protected]>;"myl353"<[email protected]>; Subject: Re: [Tianxiaomo/pytorch-YOLOv4] Is the class Yolov4 in models.py and class Darknet in darknet2pytorch.py the same model? (#69)

I'm curious about it too. Maybe we can create a Yolov4 instance model to infer, instand of a Darknet instance in demo.py? I've already tried it, unfortunately, I failed to implement this idea. if you can implement this idea, please let me kown. Thanks

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

myl980 avatar May 31 '20 01:05 myl980

您好,我昨天测试了,不能转换的原因是cfg与模型不配对,是我的原因,将cfg改正确后是可以转换的。 ---Original--- From: "oreo-lp"<[email protected]> Date: Sun, May 31, 2020 09:22 AM To: "Tianxiaomo/pytorch-YOLOv4"<[email protected]>; Cc: "Comment"<[email protected]>;"myl353"<[email protected]>; Subject: Re: [Tianxiaomo/pytorch-YOLOv4] Is the class Yolov4 in models.py and class Darknet in darknet2pytorch.py the same model? (#69) I'm curious about it too. Maybe we can create a Yolov4 instance model to infer, instand of a Darknet instance in demo.py? I've already tried it, unfortunately, I failed to implement this idea. if you can implement this idea, please let me kown. Thanks — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

我也就得models.py的Yolov4和darknet2pytorch.py的Darknet 模型不一致,请问您是怎么转换的?我都卡在这好几天了,求赐教。

YSJ305 avatar Jun 13 '20 08:06 YSJ305

I'm curious why do i have to train with Yolov4 instance model in train.py and inference with Darknet instance model. Are they same models??

Oh, I think I have to use .weights file which is the darknet format in demo.py. Then, how could I use .pth file in demo.py???

您这个想法实现了么

YSJ305 avatar Jun 13 '20 08:06 YSJ305

转的时候要将cfg的参数调好,输出的纬度要一致

---Original--- From: "YSJ305"<[email protected]> Date: Sat, Jun 13, 2020 16:39 PM To: "Tianxiaomo/pytorch-YOLOv4"<[email protected]>; Cc: "Comment"<[email protected]>;"myl353"<[email protected]>; Subject: Re: [Tianxiaomo/pytorch-YOLOv4] Is the class Yolov4 in models.py and class Darknet in darknet2pytorch.py the same model? (#69)

您好,我昨天测试了,不能转换的原因是cfg与模型不配对,是我的原因,将cfg改正确后是可以转换的。 … ---Original--- From: "oreo-lp"<[email protected]> Date: Sun, May 31, 2020 09:22 AM To: "Tianxiaomo/pytorch-YOLOv4"<[email protected]>; Cc: "Comment"<[email protected]>;"myl353"<[email protected]>; Subject: Re: [Tianxiaomo/pytorch-YOLOv4] Is the class Yolov4 in models.py and class Darknet in darknet2pytorch.py the same model? (#69) I'm curious about it too. Maybe we can create a Yolov4 instance model to infer, instand of a Darknet instance in demo.py? I've already tried it, unfortunately, I failed to implement this idea. if you can implement this idea, please let me kown. Thanks — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

我也就得models.py的Yolov4和darknet2pytorch.py的Darknet 模型不一致,请问您是怎么转换的?我都卡在这好几天了,求赐教。

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

myl980 avatar Jun 13 '20 08:06 myl980

没有,我用训练好的pth模型转的onnx,再转出来的tensorrt模型没法推理,用官方的weights转出的onnx再转的tensorrt可以推理,暂时还没办法

---Original--- From: "YSJ305"<[email protected]> Date: Sat, Jun 13, 2020 16:42 PM To: "Tianxiaomo/pytorch-YOLOv4"<[email protected]>; Cc: "Comment"<[email protected]>;"myl353"<[email protected]>; Subject: Re: [Tianxiaomo/pytorch-YOLOv4] Is the class Yolov4 in models.py and class Darknet in darknet2pytorch.py the same model? (#69)

I'm curious why do i have to train with Yolov4 instance model in train.py and inference with Darknet instance model. Are they same models??

Oh, I think I have to use .weights file which is the darknet format in demo.py. Then, how could I use .pth file in demo.py???

您这个想法实现了么

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

myl980 avatar Jun 13 '20 08:06 myl980

转的时候要将cfg的参数调好,输出的纬度要一致 ---Original--- From: "YSJ305"<[email protected]> Date: Sat, Jun 13, 2020 16:39 PM To: "Tianxiaomo/pytorch-YOLOv4"<[email protected]>; Cc: "Comment"<[email protected]>;"myl353"<[email protected]>; Subject: Re: [Tianxiaomo/pytorch-YOLOv4] Is the class Yolov4 in models.py and class Darknet in darknet2pytorch.py the same model? (#69) 您好,我昨天测试了,不能转换的原因是cfg与模型不配对,是我的原因,将cfg改正确后是可以转换的。 … ---Original--- From: "oreo-lp"<[email protected]> Date: Sun, May 31, 2020 09:22 AM To: "Tianxiaomo/pytorch-YOLOv4"<[email protected]>; Cc: "Comment"<[email protected]>;"myl353"<[email protected]>; Subject: Re: [Tianxiaomo/pytorch-YOLOv4] Is the class Yolov4 in models.py and class Darknet in darknet2pytorch.py the same model? (#69) I'm curious about it too. Maybe we can create a Yolov4 instance model to infer, instand of a Darknet instance in demo.py? I've already tried it, unfortunately, I failed to implement this idea. if you can implement this idea, please let me kown. Thanks — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe. 我也就得models.py的Yolov4和darknet2pytorch.py的Darknet 模型不一致,请问您是怎么转换的?我都卡在这好几天了,求赐教。 — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

我不太理解你说的意思,方面留个联系方式么,因为我最近因为这个问题卡了好几天了,老师也在催,所以特别想像您请教一下具体怎么操作?非常感谢!我的QQ是3189376776

YSJ305 avatar Jun 13 '20 16:06 YSJ305

@YSJ305 你好,请问你成功转换率吗

wj1017090777 avatar May 07 '21 09:05 wj1017090777

Has anybody resolve this? I have .weights trained model, and I use Yolov4 class in my project. I convert wieghts to .pth with the use of darknet2pytorch.py, but when I load it into Yolov4 class, keys in models don't match.

bobogumizelka avatar Oct 18 '21 12:10 bobogumizelka