Tensorflow for image segmentation: Changing minibatch size stops learning

試著忘記壹切 提交于 2019-12-14 04:02:33

问题


I have created a net for image segmentation, in particular brain tumors. The jupyter notebook with the code is here.

When I train the CNN with minibatch size of 1, I get a fairly good result:

But when I change the size to something larger ( 2 or more) the results are terrible:

Tensorboard shows the diference in the loss. Clearly the the net with batchsize 2 is not minimizing the loss (blue)

Any ideas on why this could be the case?


回答1:


I found the problem. I checked my graph with tensorboard and I notice that in the CONV1/S1 I was not connecting the output of the ReLu to the next layer (CONV1/S2), instead I was connecting the output of the conv2d directly.

I changed that line in the code and everything is working as expected.



来源:https://stackoverflow.com/questions/50239137/tensorflow-for-image-segmentation-changing-minibatch-size-stops-learning

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!