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

randrange and Connection refused error #390

Closed
universewill opened this issue Sep 18, 2018 · 1 comment
Closed

randrange and Connection refused error #390

universewill opened this issue Sep 18, 2018 · 1 comment

Comments

@universewill
Copy link

I run command like this:

python3 train.py --dataroot /data/images  --name my_cyclegan  --model cycle_gan --resize_or_crop crop --epoch 700 --niter 700 --display_id 0

And get error below. I dont't know why. The display_id para is set to 0 in my command, so i get it is not caused by visdom?

create web directory ./checkpoints/ketu_300_cyclegan/web...
(epoch: 1, iters: 100, time: 0.264, data: 0.159) D_A: 0.395 G_A: 0.409 cycle_A: 3.936 idt_A: 1.448 D_B: 0.489 G_B: 0.244 cycle_B: 3.068 idt_B: 1.777
Traceback (most recent call last):
  File "train.py", line 24, in <module>
    for i, data in enumerate(dataset):
  File "/home/universe/jupyter/gxl/project/digitalprint/deep/pytorch-CycleGAN-and-pix2pix/data/__init__.py", line 72, in __iter__
    for i, data in enumerate(self.dataloader):
  File "/home/universe/miniconda3/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 336, in __next__
    return self._process_next_batch(batch)
  File "/home/universe/miniconda3/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 357, in _process_next_batch
    raise batch.exc_type(batch.exc_msg)
ValueError: Traceback (most recent call last):
  File "/home/universe/miniconda3/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 106, in _worker_loop
    samples = collate_fn([dataset[i] for i in batch_indices])
  File "/home/universe/miniconda3/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 106, in <listcomp>
    samples = collate_fn([dataset[i] for i in batch_indices])
  File "/home/universe/jupyter/gxl/project/digitalprint/deep/pytorch-CycleGAN-and-pix2pix/data/unaligned_dataset.py", line 39, in __getitem__
    A = self.transform(A_img)
  File "/home/universe/miniconda3/lib/python3.6/site-packages/torchvision/transforms/transforms.py", line 49, in __call__
    img = t(img)
  File "/home/universe/miniconda3/lib/python3.6/site-packages/torchvision/transforms/transforms.py", line 421, in __call__
    i, j, h, w = self.get_params(img, self.size)
  File "/home/universe/miniconda3/lib/python3.6/site-packages/torchvision/transforms/transforms.py", line 399, in get_params
    i = random.randint(0, h - th)
  File "/home/universe/miniconda3/lib/python3.6/random.py", line 221, in randint
    return self.randrange(a, b+1)
  File "/home/universe/miniconda3/lib/python3.6/random.py", line 199, in randrange
    raise ValueError("empty range for randrange() (%d,%d, %d)" % (istart, istop, width))
ValueError: empty range for randrange() (0,-22, -22)

Exception ignored in: <bound method _DataLoaderIter.__del__ of <torch.utils.data.dataloader._DataLoaderIter object at 0x7f77ab2ebcf8>>
Traceback (most recent call last):
  File "/home/universe/miniconda3/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 399, in __del__
    self._shutdown_workers()
  File "/home/universe/miniconda3/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 378, in _shutdown_workers
    self.worker_result_queue.get()
  File "/home/universe/miniconda3/lib/python3.6/multiprocessing/queues.py", line 337, in get
    return _ForkingPickler.loads(res)
  File "/home/universe/miniconda3/lib/python3.6/site-packages/torch/multiprocessing/reductions.py", line 70, in rebuild_storage_fd
    fd = df.detach()
  File "/home/universe/miniconda3/lib/python3.6/multiprocessing/resource_sharer.py", line 57, in detach
    with _resource_sharer.get_connection(self._id) as conn:
  File "/home/universe/miniconda3/lib/python3.6/multiprocessing/resource_sharer.py", line 87, in get_connection
    c = Client(address, authkey=process.current_process().authkey)
  File "/home/universe/miniconda3/lib/python3.6/multiprocessing/connection.py", line 487, in Client
    c = SocketClient(address)
  File "/home/universe/miniconda3/lib/python3.6/multiprocessing/connection.py", line 614, in SocketClient
    s.connect(address)
ConnectionRefusedError: [Errno 111] Connection refused
@junyanz
Copy link
Owner

junyanz commented Sep 18, 2018

It is not related to the visdom. It might be caused by data augmentation. I am not 100% sure. But your image sizes might be smaller than the fineSize (cropping size).

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

2 participants