meetps / pytorch-semseg

Semantic Segmentation Architectures Implemented in PyTorch
https://meetshah.dev/semantic-segmentation/deep-learning/pytorch/visdom/2017/06/01/semantic-segmentation-over-the-years.html
MIT License
3.39k stars 796 forks source link

AttributeError: module 'scipy.misc' has no attribute 'imresize' #225

Closed keishatsai closed 5 years ago

keishatsai commented 5 years ago
 D:\pytorch-semseg>python train.py --config D:\pytorch-semseg\configs\config_segnet.yml
train.py:217: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
  cfg = yaml.load(fp)
RUNDIR: runs\config_segnet\9146
Traceback (most recent call last):
  File "train.py", line 229, in <module>
    train(cfg, writer, logger)
  File "train.py", line 118, in train
    for (images, labels) in trainloader:
  File "C:\Users\Keisha\Miniconda3\envs\segnet\lib\site-packages\torch\utils\data\dataloader.py", line 582, in __next__
    return self._process_next_batch(batch)
  File "C:\Users\Keisha\Miniconda3\envs\segnet\lib\site-packages\torch\utils\data\dataloader.py", line 608, in _process_next_batch
    raise batch.exc_type(batch.exc_msg)
AttributeError: Traceback (most recent call last):
  File "C:\Users\Keisha\Miniconda3\envs\segnet\lib\site-packages\torch\utils\data\_utils\worker.py", line 99, in _worker_loop
    samples = collate_fn([dataset[i] for i in batch_indices])
  File "C:\Users\Keisha\Miniconda3\envs\segnet\lib\site-packages\torch\utils\data\_utils\worker.py", line 99, in <listcomp>
    samples = collate_fn([dataset[i] for i in batch_indices])
  File "D:\pytorch-semseg\ptsemseg\loader\camvid_loader.py", line 59, in __getitem__
    img, lbl = self.transform(img, lbl)
  File "D:\pytorch-semseg\ptsemseg\loader\camvid_loader.py", line 64, in transform
    img = m.imresize(img, (self.img_size[0], self.img_size[1]))  # uint8 with RGB mode
AttributeError: module 'scipy.misc' has no attribute 'imresize'

I have pillow installed, but still get this error. Have anyone encounter the same issue? Thank you.

keishatsai commented 5 years ago

I have fixed by finding alternative function. You can also choose to install scipy = 1.1.0. function has been depreciated at the newer version.

18022443868 commented 4 years ago

我已经通过查找替代功能进行了修复。您也可以选择安装scipy = 1.1.0。 该功能已在较新版本中降低。

请问pytorch是哪一个版本?