DongHwanJang / SPADE_Colorization

Other
2 stars 0 forks source link

Batch 1 이상이면 터짐 #24

Closed ThisIsIsaac closed 4 years ago

ThisIsIsaac commented 4 years ago

batchSize 8 로 했을때 메세지

  File "/home/minds/isaac/SPADE_Colorization/trainers/pix2pix_trainer.py", line 44, in run_generator_one_step
    g_losses, generated, attention, conf_map = self.pix2pix_model(data, mode='generator')
  File "/home/minds/.virtualenvs/spade/lib/python3.6/site-packages/torch/nn/modules/module.py", line 547, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/minds/.virtualenvs/spade/lib/python3.6/site-packages/torch/nn/parallel/data_parallel.py", line 150, in forward
    return self.module(*inputs[0], **kwargs[0])
  File "/home/minds/.virtualenvs/spade/lib/python3.6/site-packages/torch/nn/modules/module.py", line 547, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/minds/isaac/SPADE_Colorization/models/pix2pix_model.py", line 81, in forward
    target_L, target_LAB, reference_LAB, is_reconstructing=data["is_reconstructing"])
  File "/home/minds/isaac/SPADE_Colorization/models/pix2pix_model.p
wandb: Waiting for W&B process to finish, PID 31076
y", line 176, in compute_generator_loss
    fake_rgb_np = lab_deloader(fake_LAB.detach().cpu().float().numpy().squeeze(0).transpose(1, 2, 0),
ValueError: cannot select an axis to squeeze out which has size not equal to one

@DongHwanJang 형 이거 혹시 봐줄 수 있으려나?

난 지금 디버깅용 정보 뽑는거 해보는중이야

DongHwanJang commented 4 years ago

is_reconstructing 변수가 batchsize가 1에서 B로 alter하면서 B일경우는 조건문에 걸리면서 에러를 뱉는다. 언제 alter 되는지, 어떻게 고칠지에 대한 정책 수립 필요

ThisIsIsaac commented 4 years ago

reconstruction 에 관련된 batch error 는 고쳤어. 이젠 한 batch 에 모두 동일하게 reconstruction 이 적용되. 하지만 여전히 https://github.com/DongHwanJang/SPADE_Colorization/issues/25 이 에러는 있네.

이 코드에 두번째 줄 형이 고친거야?

        if opt.use_reconstruction_loss and i % opt.reconstruction_period == 0:
            data_i["reference_LAB"] = data_i["target_LAB"].clone().detach()
            data_i["is_reconstructing"] = True
DongHwanJang commented 4 years ago

잘 기억이 안나네. 아마 그랬던거 같아

DongHwanJang commented 4 years ago

@ThisIsIsaac 혹시 해결된거면 이거는 닫을게 👍