odegeasslbc/Progressive-GAN-pytorch

error on google colab

Opened this issue · 1 comments

!git clone https://github.com/odegeasslbc/Progressive-GAN-pytorch.git
pth = '/content/drive/My Drive/gan-data/earings'
os.chdir('/content/Progressive-GAN-pytorch')
!python train.py --path '/content/drive/My Drive/gan-data' --trial_name rough1 --lr 0.003 --z_dim 100 --channel 512 --batch_size 32 --n_critic 1 --init_step 1 --total_iter 400000 --pixel_norm --tanh

used this code construct and my image folder is in the structure that you mentioned. it throws the following error. also as far as -h shows, i have no control over the final resolution, if at all. help me in either case.

Namespace(batch_size=32, channel=512, gpu_id=0, init_step=1, lr=0.003, n_critic=1, path='/content/drive/My Drive/gan-data', pixel_norm=True, tanh=True, total_iter=400000, trial_name='rough1', z_dim=100)
  0% 0/400000 [00:00<?, ?it/s]Traceback (most recent call last):
  File "train.py", line 246, in <module>
    train(generator, discriminator, args.init_step, loader, args.total_iter)
  File "train.py", line 124, in train
    real_predict.backward(mone)
  File "/usr/local/lib/python3.6/dist-packages/torch/tensor.py", line 166, in backward
    torch.autograd.backward(self, gradient, retain_graph, create_graph)
  File "/usr/local/lib/python3.6/dist-packages/torch/autograd/__init__.py", line 93, in backward
    grad_tensors = _make_grads(tensors, grad_tensors)
  File "/usr/local/lib/python3.6/dist-packages/torch/autograd/__init__.py", line 29, in _make_grads
    + str(out.shape) + ".")
RuntimeError: Mismatch in shape: grad_output[0] has a shape of torch.Size([1]) and output[0] has a shape of torch.Size([]).

I had same problem, could you share how you fixed this?