DSE-MSU / DeepRobust

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

PGD torch device inconsistency #100

Open timchenggu123 opened 2 years ago

timchenggu123 commented 2 years ago

on this line https://github.com/DSE-MSU/DeepRobust/blob/master/deeprobust/image/defense/pgdtraining.py#L219

adversary = PGD(self.model)

You guys forgot to pass in the self.device parameter, which results in inconsistency between the device in the PGD class and the PGDTraining class. I believe the correct code should be

adversary = PGD(self.model, device=self.device)

Can you guys fix that code? Thanks! :D

GumpCode commented 2 years ago

find the same error