AttributeError: module 'scipy.misc' has no attribute 'imrotate'
今天在运行程序的时候程序出现了下面的错误:、
Traceback (most recent call last): File "tools/train.py", line 144, in main() File "tools/train.py", line 117, in main optimizer, epoch, writer_dict) File "tools/../lib/core/function.py", line 57, in train for i, (inp, target, meta) in enumerate(train_loader): File "/home/eric/anaconda3/envs/albert/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 582, in __next__ return self._process_next_batch(batch) File "/home/eric/anaconda3/envs/albert/lib/python3.6/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 "/home/eric/anaconda3/envs/albert/lib/python3.6/site-packages/torch/utils/data/_utils/worker.py", line 99, in _worker_loop samples = collate_fn([dataset[i] for i in batch_indices]) File "/home/eric/anaconda3/envs/albert/lib/python3.6/site-packages/torch/utils/data/_utils/worker.py", line 99, in samples = collate_fn([dataset[i] for i in batch_indices]) File "tools/../lib/datasets/face300w.py", line 76, in __getitem__ img = crop(img, center, scale, self.input_size, rot=r) File "tools/../lib/utils/transforms.py", line 210, in crop new_img = scipy.misc.imrotate(new_img, rot)AttributeError: module 'scipy.misc' has no attribute 'imrotate'
我的scipy的版本是1.3
解决方法
pip install scipy==0.19
参考文献
[1]. scipy.misc.imrotate. https://docs.scipy.org/doc/scipy-1.1.0/reference/generated/scipy.misc.imrotate.html
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
暂时没有评论,来抢沙发吧~