Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rectangular image training failed,HELP! HELP! #1668

Open
HolicAnn opened this issue Jul 24, 2024 · 0 comments
Open

Rectangular image training failed,HELP! HELP! #1668

HolicAnn opened this issue Jul 24, 2024 · 0 comments

Comments

@HolicAnn
Copy link

My image is 860*688 rectangular image, I use the following command when training:

python train.py --dataroot ./datasets/white --name white --model pix2pix --direction AtoB --preprocess crop --crop_size 688

But when training errors, as follows
/home/alan/miniforge3/envs/torch/lib/python3.11/site-packages/torch/optim/lr_scheduler.py:136: UserWarning: Detected call of lr_scheduler.step() before optimizer.step(). In PyTorch 1.1.0 and
later, you should call them in the opposite order: optimizer.step() before lr_scheduler.step(). Failure to do this will result in PyTorch skipping the first value of the learning rate schedule. See more details at https://pytorch.org/docs/stable/optim.html#how-to-adjust-learning-rate
warnings.warn("Detected call of lr_scheduler.step() before optimizer.step(). "
learning rate 0.0002000 -> 0.0002000
Traceback (most recent call last):
File "/mnt/c/Users/Alan/Desktop/pytorch-CycleGAN-and-pix2pix-master/train.py", line 56, in
model.optimize_parameters() # calculate loss functions, get gradients, update network weights
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/mnt/c/Users/Alan/Desktop/pytorch-CycleGAN-and-pix2pix-master/models/pix2pix_model.py", line 117, in optimize_parameters
self.forward() # compute fake images: G(A)
^^^^^^^^^^^^^^
File "/mnt/c/Users/Alan/Desktop/pytorch-CycleGAN-and-pix2pix-master/models/pix2pix_model.py", line 88, in forward
self.fake_B = self.netG(self.real_A) # G(A)
^^^^^^^^^^^^^^^^^^^^^^
File "/home/alan/miniforge3/envs/torch/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/alan/miniforge3/envs/torch/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/alan/miniforge3/envs/torch/lib/python3.11/site-packages/torch/nn/parallel/data_parallel.py", line 183, in forward
return self.module(*inputs[0], **module_kwargs[0])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/alan/miniforge3/envs/torch/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/alan/miniforge3/envs/torch/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/mnt/c/Users/Alan/Desktop/pytorch-CycleGAN-and-pix2pix-master/models/networks.py", line 466, in forward
return self.model(input)
^^^^^^^^^^^^^^^^^
File "/home/alan/miniforge3/envs/torch/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/alan/miniforge3/envs/torch/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/mnt/c/Users/Alan/Desktop/pytorch-CycleGAN-and-pix2pix-master/models/networks.py", line 543, in forward
model_output = self.model(x)
^^^^^^^^^^^^^
File "/home/alan/miniforge3/envs/torch/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/alan/miniforge3/envs/torch/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/alan/miniforge3/envs/torch/lib/python3.11/site-packages/torch/nn/modules/container.py", line 215, in forward
input = module(input)
^^^^^^^^^^^^^
File "/home/alan/miniforge3/envs/torch/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/alan/miniforge3/envs/torch/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/mnt/c/Users/Alan/Desktop/pytorch-CycleGAN-and-pix2pix-master/models/networks.py", line 543, in forward
model_output = self.model(x)
^^^^^^^^^^^^^
File "/home/alan/miniforge3/envs/torch/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/alan/miniforge3/envs/torch/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/alan/miniforge3/envs/tor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant