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

为什么训练集和验证集的时间会相差这么多

Open cymdhx opened this issue 4 years ago • 28 comments

cymdhx avatar Jan 18 '21 10:01 cymdhx

validation involves data format transformation which is implement on CPU and single-thread. NMS as well. Also, if you enable multi-scale eval, this preprocessing of images and bboxes might be even more computational demanding.

I would suggest that you disalbe multi-scale eval and disable all data-augmentation in the eval process. Further more you can write the data format transform using multithread. This might speed up the whole process a lot.

jingtianyilong avatar Jan 19 '21 02:01 jingtianyilong

validation involves data format transformation which is implement on CPU and single-thread. NMS as well. Also, if you enable multi-scale eval, this preprocessing of images and bboxes might be even more computational demanding.

I would suggest that you disalbe multi-scale eval and disable all data-augmentation in the eval process. Further more you can write the data format transform using multithread. This might speed up the whole process a lot.

image 大佬 可以问一下 这是那里出错了吗

cymdhx avatar Jan 19 '21 03:01 cymdhx

验证包括在CPU和单线程上实现的数据格式转换.NMS也是。此外,如果您启用了多尺度评估,这种图像和bbox的预处理可能需要更多的计算量。

我建议你取消多尺度的评估,并禁用在评估过程中的所有数据增强。此外,您还可以使用多线程编写数据格式转换。这可能会大大加快整个过程。

image 就是一到val就报错

cymdhx avatar Jan 19 '21 04:01 cymdhx

seems like the box list for nms too large. Which is actually not large at all. Check your memory? Haven't seen anything like this before.

jingtianyilong avatar Jan 19 '21 06:01 jingtianyilong

As I said. Check your memory first. As I see, you are using windows, so task manager would help you to see your memory status.

jingtianyilong avatar Jan 19 '21 09:01 jingtianyilong

As I said. Check your memory first. As I see, you are using windows, so task manager would help you to see your memory status.

实在是太感谢了 我好像把文件都放在桌面了 所以导致内存爆了 谢谢

cymdhx avatar Jan 19 '21 09:01 cymdhx

As I said. Check your memory first. As I see, you are using windows, so task manager would help you to see your memory status.

不知道你试过没有我觉得最新的代码有bug 只要一到val训练内存就会一直上涨到最后爆内存

cymdhx avatar Jan 19 '21 11:01 cymdhx

image

cymdhx avatar Jan 19 '21 11:01 cymdhx

像这样一样 我使用以前的就不会有这个bug 而且我batch只调到了2

cymdhx avatar Jan 19 '21 11:01 cymdhx

As I said. Check your memory first. As I see, you are using windows, so task manager would help you to see your memory status.

I think it's problem about attention map

cymdhx avatar Jan 19 '21 12:01 cymdhx

As I said. Check your memory first. As I see, you are using windows, so task manager would help you to see your memory status.

I think it's problem about attention map

First, batch size would not efffect eval imo. Cuz you only use 1 image every time.

About memory, you need to have a larger memory to run this. The way I understand is that output from model is too large. If you don't want to buy new RAM stick, you should decrease the input size, disable attention, disable multi-scale val, disable augmentation on eval.

jingtianyilong avatar Jan 20 '21 02:01 jingtianyilong

就像我说的。先检查一下你的记忆。正如我所看到的,您正在使用windows,因此任务管理器将帮助您查看内存状态。

我想这是关于注意力图的问题

第一,批次大小不会影响世界海事组织。因为你每次只使用一张图片。

关于内存,您需要有一个更大的内存来运行它。我的理解是,模型的输出太大了。如果你不想买新的RAM棒,你应该减少输入的大小,禁用注意力,禁用多尺度的Val,禁用val上的增强。

谢谢老哥,我现在是16G的内存,最新的这个代码我需要多大的内存合适呢,还有我想知道新加的showatte模块的作用是什么呢,谢谢了

cymdhx avatar Jan 20 '21 02:01 cymdhx

就像我说的.先检查一下你的记忆.正如我所看到的,您正在使用窗口,因此任务管理器将帮助您查看内存状态。

我想这是关于注意力图的问题

第一,批次大小不会影响世界海事组织.因为你每次只使用一张图片.

关于内存,您需要有一个更大的内存来运行它.我的理解是,模型的输出太大了.如果你不想买新的RAM棒,你应该减少输入的大小,禁用注意力,禁用多尺度的Val,禁用Val上的增强.

就是我看1月份刚加的showatte和model模块具体是干嘛的 谢谢大佬

cymdhx avatar Jan 20 '21 02:01 cymdhx

就像我说的.先检查一下你的记忆.正如我所看到的,您正在使用窗口,因此任务管理器将帮助您查看内存状态。

我想这是关于注意力图的问题

第一,批次大小不会影响世界海事组织.因为你每次只使用一张图片.

关于内存,您需要有一个更大的内存来运行它.我的理解是,模型的输出太大了.如果你不想买新的RAM棒,你应该减少输入的大小,禁用注意力,禁用多尺度的Val,禁用Val上的增强.

我刚刚把多线程的代码去掉 发现就能正常运行了 我想可能我电脑带不动多线程的代码把 这几次还是多谢老哥了

cymdhx avatar Jan 20 '21 02:01 cymdhx

就像我说的。先检查一下你的记忆。正如我所看到的,您正在使用windows,因此任务管理器将帮助您查看内存状态。

我想这是关于注意力图的问题

第一,批次大小不会影响世界海事组织。因为你每次只使用一张图片。 关于内存,您需要有一个更大的内存来运行它。我的理解是,模型的输出太大了。如果你不想买新的RAM棒,你应该减少输入的大小,禁用注意力,禁用多尺度的Val,禁用val上的增强。

谢谢老哥,我现在是16G的内存,最新的这个代码我需要多大的内存合适呢,还有我想知道新加的showatte模块的作用是什么呢,谢谢了

show_atte = show attention. This will output with attention heatmap. Menmory requirement depends on your application. my workstation and server have 128G and 500G RAM , so I never suffer from this and never notice this.

jingtianyilong avatar Jan 20 '21 06:01 jingtianyilong

就像我说的.先检查一下你的记忆.正如我所看到的,您正在使用窗口,因此任务管理器将帮助您查看内存状态。

我想这是关于注意力图的问题

第一,批次大小不会影响世界海事组织.因为你每次只使用一张图片.关于内存,您需要有一个更大的内存来运行它.我的理解是,模型的输出太大了.如果你不想买新的RAM棒,你应该减少输入的大小,禁用注意力,禁用多尺度的Val,禁用Val上的增强.

谢谢老哥,我现在是16G的内存,最新的这个代码我需要多大的内存合适呢,还有我想知道新加的展示模块的作用是什么呢,谢谢了

show_atte注意。这将输出与关注热点图。 Menmory需求取决于您的应用程序。我的工作站和服务器有128 G和500 g RAM,所以我从来没有受到这种影响,也从未注意到这一点。

好的 谢谢大佬

cymdhx avatar Jan 20 '21 06:01 cymdhx

就像我说的.先检查一下你的记忆.正如我所看到的,您正在使用窗口,因此任务管理器将帮助您查看内存状态。

我想这是关于注意力图的问题

第一,批次大小不会影响世界海事组织.因为你每次只使用一张图片. 关于内存,您需要有一个更大的内存来运行它.我的理解是,模型的输出太大了.如果你不想买新的RAM棒,你应该减少输入的大小,禁用注意力,禁用多尺度的Val,禁用Val上的增强.

就是我看1月份刚加的showatte和model模块具体是干嘛的 谢谢大佬

Attention basically means that the network would prioritize region that are more informative. Like a kind of factor or weight.

In general, attention helps improves the performance. But it's not a MUST

jingtianyilong avatar Jan 20 '21 06:01 jingtianyilong

就像我说的.先检查一下你的记忆.正如我所看到的,您正在使用窗口,因此任务管理器将帮助您查看内存状态.

我想这是关于注意力图的问题

第一,批次大小不会影响世界海事组织.因为你每次只使用一张图片.关于内存,您需要有一个更大的内存来运行它.我的理解是,模型的输出太大了.如果你不想买新的RAM棒,你应该减少输入的大小,禁用注意力,禁用多尺度的Val,禁用Val上的增强.

就是我看1月份刚加的展示和模型模块具体是干嘛的谢谢大佬

注意基本上意味着网络将优先考虑信息更丰富的区域。就像某种因素或重量。

一般来说,注意力有助于提高绩效。但这不是必须的

大佬 我问一下DO_CONV代码里有体现吗 我怎么感觉没有进进去 是我没找到吗

cymdhx avatar Feb 02 '21 10:02 cymdhx

就像我说的.先检查一下你的记忆.正如我所看到的,您正在使用窗口,因此任务管理器将帮助您查看内存状态。

我想这是关于注意力图的问题

第一,批次大小不会影响世界海事组织.因为你每次只使用一张图片. 关于内存,您需要有一个更大的内存来运行它.我的理解是,模型的输出太大了.如果你不想买新的RAM棒,你应该减少输入的大小,禁用注意力,禁用多尺度的Val,禁用Val上的增强.

就是我看1月份刚加的showatte和model模块具体是干嘛的 谢谢大佬

Attention basically means that the network would prioritize region that are more informative. Like a kind of factor or weight.

In general, attention helps improves the performance. But it's not a MUST

请问这份代码用到了Mosaic方法吗

cymdhx avatar Feb 05 '21 12:02 cymdhx

就像我说的.先检查一下你的记忆.正如我所看到的,您正在使用窗口,因此任务管理器将帮助您查看内存状态。

我想这是关于注意力图的问题

第一,批次大小不会影响世界海事组织.因为你每次只使用一张图片. 关于内存,您需要有一个更大的内存来运行它.我的理解是,模型的输出太大了.如果你不想买新的RAM棒,你应该减少输入的大小,禁用注意力,禁用多尺度的Val,禁用Val上的增强.

就是我看1月份刚加的showatte和model模块具体是干嘛的 谢谢大佬

Attention basically means that the network would prioritize region that are more informative. Like a kind of factor or weight. In general, attention helps improves the performance. But it's not a MUST

请问这份代码用到了Mosaic方法吗

No. But I got mosaic integrated. You can use my code and integrate into this repo. https://github.com/jingtianyilong/YOLOv4-pytorch/blob/00c81b547bd968209f9fa636727d7ce16be4236c/utils/datasets.py#L41-L120

jingtianyilong avatar Feb 07 '21 01:02 jingtianyilong

就像我说的.先检查一下你的记忆.正如我所看到的,您正在使用窗口,因此任务管理器将帮助您查看内存状态。

我想这是关于注意力图的问题

第一,批次大小不会影响世界海事组织.因为你每次只使用一张图片. 关于内存,您需要有一个更大的内存来运行它.我的理解是,模型的输出太大了.如果你不想买新的RAM棒,你应该减少输入的大小,禁用注意力,禁用多尺度的Val,禁用Val上的增强.

就是我看1月份刚加的showatte和model模块具体是干嘛的 谢谢大佬

Attention basically means that the network would prioritize region that are more informative. Like a kind of factor or weight. In general, attention helps improves the performance. But it's not a MUST

请问这份代码用到了Mosaic方法吗

No. But I got mosaic integrated. You can use my code and integrate into this repo. https://github.com/jingtianyilong/YOLOv4-pytorch/blob/00c81b547bd968209f9fa636727d7ce16be4236c/utils/datasets.py#L41-L120

感谢感谢 大佬 不知道加了马赛克效果会有提升吗

cymdhx avatar Feb 11 '21 01:02 cymdhx

就像我说的.先检查一下你的记忆.正如我所看到的,您正在使用窗口,因此任务管理器将帮助您查看内存状态。

我想这是关于注意力图的问题

第一,批次大小不会影响世界海事组织.因为你每次只使用一张图片. 关于内存,您需要有一个更大的内存来运行它.我的理解是,模型的输出太大了.如果你不想买新的RAM棒,你应该减少输入的大小,禁用注意力,禁用多尺度的Val,禁用Val上的增强.

就是我看1月份刚加的showatte和model模块具体是干嘛的 谢谢大佬

Attention basically means that the network would prioritize region that are more informative. Like a kind of factor or weight. In general, attention helps improves the performance. But it's not a MUST

请问这份代码用到了Mosaic方法吗

No. But I got mosaic integrated. You can use my code and integrate into this repo. https://github.com/jingtianyilong/YOLOv4-pytorch/blob/00c81b547bd968209f9fa636727d7ce16be4236c/utils/datasets.py#L41-L120

就像我说的.先检查一下你的记忆.正如我所看到的,您正在使用窗口,因此任务管理器将帮助您查看内存状态。

我想这是关于注意力图的问题

第一,批次大小不会影响世界海事组织.因为你每次只使用一张图片. 关于内存,您需要有一个更大的内存来运行它.我的理解是,模型的输出太大了.如果你不想买新的RAM棒,你应该减少输入的大小,禁用注意力,禁用多尺度的Val,禁用Val上的增强.

就是我看1月份刚加的showatte和model模块具体是干嘛的 谢谢大佬

Attention basically means that the network would prioritize region that are more informative. Like a kind of factor or weight. In general, attention helps improves the performance. But it's not a MUST

请问这份代码用到了Mosaic方法吗

No. But I got mosaic integrated. You can use my code and integrate into this repo. https://github.com/jingtianyilong/YOLOv4-pytorch/blob/00c81b547bd968209f9fa636727d7ce16be4236c/utils/datasets.py#L41-L120

感谢感谢 大佬 不知道加了马赛克效果会有提升吗

大佬还有补充一下就是加了你的代码需要将__creat_label里的box_mix改为1 我想问问这个box_mix作用是啥啊 这个改了会有影响吗

cymdhx avatar Feb 11 '21 03:02 cymdhx

就像我说的.先检查一下你的记忆.正如我所看到的,您正在使用窗口,因此任务管理器将帮助您查看内存状态.

我想这是关于注意力图的问题

第一,批次大小不会影响世界海事组织.因为你每次只使用一张图片.关于内存,您需要有一个更大的内存来运行它.我的理解是,模型的输出太大了.如果你不想买新的RAM棒,你应该减少输入的大小,禁用注意力,禁用多尺度的Val,禁用Val上的增强.

就是我看1月份刚加的展示和模型模块具体是干嘛的谢谢大佬

注意基本上意味着网络将优先考虑信息更丰富的区域.就像某种因素或重量.一般来说,注意力有助于提高绩效.但这不是必须的

马赛克请问这份代码用到了方法吗

没有。但我整合了马赛克。您可以使用我的代码,并集成到这个回购。 Https://github.com/jingtianyilong/YOLOv4-pytorch/blob/00c81b547bd968209f9fa636727d7ce16be4236c/utils/datasets.py#L41-L120

image

大佬换成你的代码后 这个错误是为什么

cymdhx avatar Feb 11 '21 07:02 cymdhx

就像我说的.先检查一下你的记忆.正如我所看到的,您正在使用窗口,因此任务管理器将帮助您查看内存状态.

我想这是关于注意力图的问题

第一,批次大小不会影响世界海事组织.因为你每次只使用一张图片.关于内存,您需要有一个更大的内存来运行它.我的理解是,模型的输出太大了.如果你不想买新的RAM棒,你应该减少输入的大小,禁用注意力,禁用多尺度的Val,禁用Val上的增强.

就是我看1月份刚加的展示和模型模块具体是干嘛的谢谢大佬

注意基本上意味着网络将优先考虑信息更丰富的区域.就像某种因素或重量.一般来说,注意力有助于提高绩效.但这不是必须的

马赛克请问这份代码用到了方法吗

没有。但我整合了马赛克。您可以使用我的代码,并集成到这个回购。 Https://github.com/jingtianyilong/YOLOv4-pytorch/blob/00c81b547bd968209f9fa636727d7ce16be4236c/utils/datasets.py#L41-L120

image

大佬换成你的代码后 这个错误是为什么

就是val结束后无法进入下一个epoch,需要自己重新run才能继续

cymdhx avatar Feb 11 '21 07:02 cymdhx

大佬换成你的代码后 这个错误是为什么

You don't have sufficient GPU mem. Try with smaller batch_size. Or you should give up on this.

jingtianyilong avatar Feb 12 '21 02:02 jingtianyilong

大佬换成你的代码后 这个错误是为什么

You don't have sufficient GPU mem. Try with smaller batch_size. Or you should give up on this.

大佬 如果我不使用预训练权重 那我能够达到很好的map值吗,或者说我不用预训练,增加epoch的次数 能达到靠近使用预训练的map吗

cymdhx avatar Mar 21 '21 11:03 cymdhx

For this I would recommand this paper Rethinking ImageNet Pre-training from Kaiming He. @ICCV2019. In short. No, pre-train is not necessary. You can achieve the same level with longer training.

jingtianyilong avatar Mar 22 '21 01:03 jingtianyilong

为此,我会推荐 Kaiming He 的这篇论文Rethinking ImageNet Pre-training 。@ICCV2019。 总之。不,不需要预训练。您可以通过更长时间的训练达到相同的水平。

Excuse me, train has turned on multi_ SCALE_ Train and val also need to open multi_ SCALE_ Train

cymdhx avatar Aug 20 '21 13:08 cymdhx