RuntimeError: expand(torch.cuda.FloatTensor{[1, 3, 512, 512]}, size=[3, 512, 512]): the number of sizes provided (3) must be greater or equal to the number of dimensions in the tensor (4)
change comment line
if ganIterations % opt.evalIter == 0: val_batch_output = torch.FloatTensor(val_input.size()).fill_(0) for idx in range(val_input.size(0)): single_img = val_input[idx,:,:,:].unsqueeze(0) val_inputv = Variable(single_img, volatile=True) x_hat_val, x_hat_val2, x_hat_val3, dehaze21 = netG(val_inputv) val_batch_output[idx,:,:,:].copy_(dehaze21.data.squeeze(0))################add .squeeze(0) vutils.save_image(val_batch_output, '%s/generated_epoch_%08d_iter%08d.png' % \ (opt.exp, epoch, ganIterations), normalize=False, scale_each=False)
RuntimeError: expand(torch.cuda.FloatTensor{[1, 3, 512, 512]}, size=[3, 512, 512]): the number of sizes provided (3) must be greater or equal to the number of dimensions in the tensor (4)
change comment lineif ganIterations % opt.evalIter == 0: val_batch_output = torch.FloatTensor(val_input.size()).fill_(0) for idx in range(val_input.size(0)): single_img = val_input[idx,:,:,:].unsqueeze(0) val_inputv = Variable(single_img, volatile=True) x_hat_val, x_hat_val2, x_hat_val3, dehaze21 = netG(val_inputv) val_batch_output[idx,:,:,:].copy_(dehaze21.data.squeeze(0))################add .squeeze(0) vutils.save_image(val_batch_output, '%s/generated_epoch_%08d_iter%08d.png' % \ (opt.exp, epoch, ganIterations), normalize=False, scale_each=False)