DSE-MSU / DeepRobust

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

AttributeError: 'Dataset' object has no attribute 'root' Dataset of deeprobust #138

Open ppoopp2er2er opened 1 year ago

ppoopp2er2er commented 1 year ago

from deeprobust.graph.data import Dataset

Traceback (most recent call last): ..... File "D:\ProgramData\anaconda3\envs\ai\lib\site-packages\deeprobust\graph\data\dataset.py", line 99, in get_prognn_splits json_file = osp.join(self.root, AttributeError: 'Dataset' object has no attribute 'root'

first: open the file :D:\ProgramData\anaconda3\envs\ai\Lib\site-packages\deeprobust\graph\data\dataset.py second: line 67: "root = root" should be revised as "slef.root = root"

chengwuxinlin commented 1 year ago

thanks, this did solve the issue. BTW, it should be self.root = root

FinAminToastCrunch commented 1 year ago

Hi, I am the reason you are getting this error as I submitted a pull request to do this. I accidentally wrote root = root rather than self.root = root. Normally, it would infer the root from os.path. This would work fine on linux but it would not work on windows. That is why you must specify self.root if you are using deeprobust with windows. Thank you @chengwuxinlin for answering the question.