deeplabv3-plus-pytorch icon indicating copy to clipboard operation
deeplabv3-plus-pytorch copied to clipboard

关于替换为我自己的数据集训练的问题

Open Codingaworld opened this issue 3 years ago • 2 comments

我替换为自己的数据集进行训练,但是一直遇到ValueError: Expected more than 1 value per channel when training, got input size torch.Size([1, 256, 1, 1]),这个报错,百度了都说是batch_size可能多出来了,把drop_last设置为true就好了。可是我看你的代码里是设置的true啊,请问up怎么解决呢,我这边cuda:10.1 pytorch:1.2.0

Codingaworld avatar Nov 10 '22 08:11 Codingaworld

batch设置成偶数

bubbliiiing avatar Nov 15 '22 16:11 bubbliiiing

通过终端指定单显卡解决了这个问题,猜测是会自动分散到多个显卡,导致出现batch_size的问题

Wtbg avatar Mar 07 '24 07:03 Wtbg