DSE-MSU / DeepRobust

A pytorch adversarial library for attack and defense methods on images and graphs
MIT License
994 stars 192 forks source link

No module named 'scipy._lib.six' #48

Closed AllenWu18 closed 3 years ago

AllenWu18 commented 3 years ago

Hi, I tried to run the demo like import deeprobust.image.netmodels.train_model as trainmodel trainmodel.train('CNN', 'MNIST', 'cuda', 20)

on the Readme but it just showed the following error report:

Traceback (most recent call last):

File "/home/ubuntu/codew/untitled0.py", line 9, in import deeprobust.image.netmodels.train_model as trainmodel

File "/home/ubuntu/anaconda3/lib/python3.8/site-packages/deeprobust/image/init.py", line 3, in from deeprobust.image import attack

File "/home/ubuntu/anaconda3/lib/python3.8/site-packages/deeprobust/image/attack/init.py", line 9, in from deeprobust.image.attack import cw

File "/home/ubuntu/anaconda3/lib/python3.8/site-packages/deeprobust/image/attack/cw.py", line 9, in from deeprobust.image.optimizer import AdamOptimizer

File "/home/ubuntu/anaconda3/lib/python3.8/site-packages/deeprobust/image/optimizer.py", line 19, in from scipy._lib.six import xrange, string_types

ModuleNotFoundError: No module named 'scipy._lib.six'

The current version of my Scipy is 1.5.2, and it seems that the subpackage "scipy._lib.six" has been removed from the newest Scipy, so I wanna know how to solve the problem.

Many Thx :)

YaxinLi0-0 commented 3 years ago

Thanks for posting this question! I've update the code and replaced the functions in scipy._lib.six with the current ones. Welcome to try again.