yaoppeng / U-Net_v2

215 stars 20 forks source link

how to solve the error 'ValueError: too many values to unpack (expected 2)' #9

Open Truant-jason opened 11 months ago

Truant-jason commented 11 months ago

Traceback (most recent call last): File "D:\Unet V2\PolypSeg\Train.py", line 341, in train(train_loader, model, optimizer, epoch, opt.test_path) File "D:\Unet V2\PolypSeg\Train.py", line 145, in train P1, P2= model(images) ValueError: too many values to unpack (expected 2)

yaoppeng commented 11 months ago

Sorry about the mistake. I forgot to uncomment the code in lib/pvt_3.py. Fixed it.

if self.deep_supervision:
    return F.interpolate(out1, scale_factor=8, mode='bilinear'), \
                F.interpolate(out2, scale_factor=4, mode='bilinear')
else:
    return F.interpolate(out2, scale_factor=4, mode='bilinear')