RuntimeError: The size of tensor a (512) must match the size of tensor b (256) at non-singleton dimension 0
chengkeng opened this issue · 4 comments
I want to train a 256*256 data set model in Google, and the result shows that the subject is wrong.
Constructing networks...
Resuming from "./pretrained/network-snapshot-001814.pkl"
Traceback (most recent call last):
File "train.py", line 566, in
main() # pylint: disable=no-value-for-parameter
File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 829, in call
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/click/decorators.py", line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File "train.py", line 559, in main
subprocess_fn(rank=0, args=args, temp_dir=temp_dir)
File "train.py", line 408, in subprocess_fn
training_loop.training_loop(rank=rank, **args)
File "/content/drive/My Drive/colab-sg2-ada-pytorch/stylegan2-ada-pytorch/training/training_loop.py", line 158, in training_loop
misc.copy_params_and_buffers(resume_data[name], module, require_all=False)
File "/content/drive/My Drive/colab-sg2-ada-pytorch/stylegan2-ada-pytorch/torch_utils/misc.py", line 160, in copy_params_and_buffers
tensor.copy_(src_tensors[name].detach()).requires_grad_(tensor.requires_grad)
RuntimeError: The size of tensor a (512) must match the size of tensor b (256) at non-singleton dimension 0
The 512 mentioned in it, can't I train 256 data sets and models?
Thank you
@chengkeng Did u find the solution?
@chengkeng Did u find the solution?
Without a solution, I cannot use the 256256 model transfer learning to train the 256256 data set. I must use the 512512 model to transfer the learning to the 256256 data set. And 256256 checkpoints cannot continue training, and 512512 must be used to train 256*256. Why is this?
I'm having the same problem. I want to transfer from 256x256 to 512x512. I've successfully done this for all lower-res pairs (32x32 -> 64x64 -> 128x128 -> 256x256), but I'm getting an error for 256x256->512x512. I have not tried 512x512->1024x1024 yet but will also check that.
Is there a solution and where can I find it?
@chengkeng & @oitoito : Hi,
Are your datasets multi-labeled? I have the same problem BUT only with multi-labeled set.
I opened an issue about it: https://github.com/NVlabs/stylegan2-ada-pytorch/issues/98