DSE-MSU / DeepRobust

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

MetaAttack will OOM if PyTorch>1.9 #127

Open likuanppd opened 1 year ago

likuanppd commented 1 year ago

Hi jin,

we find that MetaAttack will face the OOM problem if the PyTorch version is higher than 1.9. Can you fix this problem? For example, we attack polblogs under 20% ptb rate in one tesla-v100 (32GB), and then the cuda will OOM. We retry this in another Linux server and it reports the same error, but if we turn the pytorch version into 1.8.2, everything would be ok.

Thanks

Leirunlin commented 1 year ago

Hi! I write an issue in #128, which seems to be helpful in avoiding OOM in MetaAttack. I didn't check the solution thoroughly on different devices. Please let me know if it could be also helpful to you. Thanks.

likuanppd commented 1 year ago

I've tried your solution, and it works perfectly. Good job!