Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

您好!请问pytorch官方实现版提供的LITS预训练模型,是关闭deep_supervision跑的么 #74

Open
cuihu1998 opened this issue Nov 4, 2021 · 7 comments

Comments

@cuihu1998
Copy link

因为看到loss_functions/deep_supervision.py中的deep_supervision计算loss的逻辑被注解掉了。看样子是模型关掉了deep_supervision跑的

@cuihu1998
Copy link
Author

求教。使用默认的代码跑LITS,效果很差,跑不出提供的progress.png显示出的效果,在提供的代码上跑nnUNet效果倒是很正常,

@cuihu1998
Copy link
Author

我始终无法复现提供的效果的loss图。用nnUNet跑了一遍loss确实和图基本一致,一路降到-4。
但是用UNet++,loss很难收敛,到100个epoch才不到-1.0,和图里的效果相差太大了.....

@cuihu1998
Copy link
Author

我尝试只改动了paths.py配置数据集路径,其余的部分和源码一致丝毫未改。但是progress.png显示loss下降速度比图里慢的太多了。真心求教!

@ChibisukeDragon
Copy link

同学,我不清楚你问题的答案,但是想和你交流一下。
我按作者在readme里“How to use UNet++”的步骤,结果在“Liver and tumour segmentation in Medical Segmentation Decathlon”上曲线乱飞。batchsize调到4时,占用V100约99%的显存,曲线也不行。想交流看看,你是怎么设置的实验的?

@cuihu1998
Copy link
Author

@ChibisukeDragon 基于nnunet的默认plans是batchs_size=2,默认的UNet++用上deep supervision大概要占24G显存。再调大batchsize显存肯定不够。作者在提供的代码里,在trainer部分应该改成output[0], deep_supervision.py里有深度监督的逻辑也被注释了,得把这些都开下来才能跑出正常的曲线。但是速度真是极其慢,极其慢。3090一个epoch大概300多秒

@ChibisukeDragon
Copy link

我当时看到的是这个issue:#15
作者如果配置使用3d_fullres,单卡根本开不到12的batchsize。。。
所以没收敛是因为没开deep supervision的问题吗?!我一直以为是batchsize太小才不收敛 @cuihu1998

@cuihu1998
Copy link
Author

@ChibisukeDragon 图里loss快速掉到-1然后最终收敛到-3、-4这种情况,是开deep supervision的,因为多个layer的loss全加在一起了。不开监督loss就会没图里那么低。3d_fullres bs开不到那么大的,12是2d的默认batchsize。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants