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

Pytorch 0.4.0 issue #49

Open
blueclowd opened this issue Apr 29, 2020 · 2 comments
Open

Pytorch 0.4.0 issue #49

blueclowd opened this issue Apr 29, 2020 · 2 comments

Comments

@blueclowd
Copy link

Sharing with this issue on Pytorch 0.4.0

Traceback (most recent call last):
File "train_textsnake.py", line 241, in
main()
File "train_textsnake.py", line 226, in main
train(model, train_loader, criterion, scheduler, optimizer, epoch, logger)
File "train_textsnake.py", line 66, in train
for i, (img, train_mask, tr_mask, tcl_mask, radius_map, sin_map, cos_map, meta) in enumerate(train_loader):
File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/dataloader.py", line 451, in iter
return _DataLoaderIter(self)
File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/dataloader.py", line 247, in init
self._put_indices()
File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/dataloader.py", line 295, in _put_indices
indices = next(self.sample_iter, None)
File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/sampler.py", line 138, in iter
for idx in self.sampler:
File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/sampler.py", line 51, in iter
return iter(torch.randperm(len(self.data_source)).tolist())
RuntimeError: randperm is only implemented for CPU

=======================================================
In my case, I need to install other versions of PyTorch to solve this issue.

@15926273249
Copy link

请问这个问题解决了吗

@blueclowd
Copy link
Author

Hi, @15926273249

我沒有細究這個issue的原因,不過換了pytorch 的版本就沒有這個問題了。以下是我的安裝指令,給您參考:
pip install torch==1.5.0+cu101 torchvision==0.6.0+cu101 -f https://download.pytorch.org/whl/torch_stable.html

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