DSE-MSU / DeepRobust

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

These is always a bug : 'numpy.ndarray' object has no attribute 'A1' #59

Closed forechoandlook closed 3 years ago

forechoandlook commented 3 years ago

image

EdisonLeeeee commented 3 years ago

Maybe your adj is a numpy array instead of a scipy sparse matrix?

forechoandlook commented 3 years ago

You mean that adj should be a scipy sparse matrix?

EdisonLeeeee commented 3 years ago

Yes, it must be.

forechoandlook commented 3 years ago

Ok, I will try! Thanks!

ChandlerBang commented 3 years ago

Hi, thank you, EdisonLeeeee . But the bug happens at self.feature_scores(). So that means the feature matrix should be a scipy sparse matrix.

EdisonLeeeee commented 3 years ago

You are absolutely right.

pqypq commented 1 year ago

Hi! I made some modifications to use the "scipy.sparse.csr_matrix" function to make the "X_influencers" to be a scipy sparse matrix. However, when I run the polblogs dataset, I still got the error AttributeError: 'numpy.ndarray' object has no attribute 'A1' Can you give some suggestions for solving this problem? Thanks