princewang1994 / TextSnake.pytorch

A PyTorch implementation of ECCV2018 Paper: TextSnake: A Flexible Representation for Detecting Text of Arbitrary Shapes
https://arxiv.org/abs/1807.01544
MIT License
437 stars 92 forks source link

Pytorch 0.4.0 issue #49

Open blueclowd opened 4 years ago

blueclowd commented 4 years ago

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 commented 4 years ago

请问这个问题解决了吗

blueclowd commented 4 years ago

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