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.
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.