-
Notifications
You must be signed in to change notification settings - Fork 359
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
RuntimeError in python3 #35
Comments
Please check Issue 17. |
@CherylZR I also met the same question. Have you solved it? |
@mingyuliutw |
@benjaminlinken I rewrote the dataloader in python 3 and solved it. |
@CherylZR Can you tell me how you rewrote the dataloader? |
@benjaminlinken it's very simple by just setting the right dataset, sample mode, etc. you can refer to the official document |
@CherylZR Can you please tell me more details? I really don't know how to rewrote the dataloader. |
@CherylZR Or you can send the modified files to my email, my email is 1278217355@qq.com. Thank you for your help! |
Hi! Thank you very much for sharing your code. I encountered some error when training from scratch with celeba blond hair translation using python 3 according to the usage. The itertool.izip in python2 is changed to the built-in zip in python3:
Traceback (most recent call last): File "cocogan_train.py", line 88, in <module> main(sys.argv) File "cocogan_train.py", line 56, in main for it, (images_a, images_b) in enumerate(zip(train_loader_a,train_loader_b)): File "/home/fox/anaconda3/lib/python3.5/site-packages/torch/utils/data/dataloader.py", line 301, in __iter__ return DataLoaderIter(self) File "/home/fox/anaconda3/lib/python3.5/site-packages/torch/utils/data/dataloader.py", line 171, in __init__ self._put_indices() File "/home/fox/anaconda3/lib/python3.5/site-packages/torch/utils/data/dataloader.py", line 210, in _put_indices indices = next(self.sample_iter, None) File "/home/fox/anaconda3/lib/python3.5/site-packages/torch/utils/data/sampler.py", line 115, in __iter__ for idx in self.sampler: File "/home/fox/anaconda3/lib/python3.5/site-packages/torch/utils/data/sampler.py", line 50, in __iter__ return iter(torch.randperm(len(self.data_source)).long()) RuntimeError: invalid argument 1: must be strictly positive at /opt/conda/conda-bld/pytorch_1503968623488/work/torch/lib/TH/generic/THTensorMath.c:2033
How can I fix this problem?
The text was updated successfully, but these errors were encountered: