Open momo1986 opened 2 years ago
Hi,
I think a solution could be to use a wrapper like
class NewModel():
def __init__(self, model):
self.model = model
def __call__(self, x):
return self.model(x)[0]
on your model, so that it returns only the first element (this is similar to https://github.com/fra31/auto-attack/issues/16).
Hope this helps!
Hi, dear Frank.
I met the problem caused by PyTorch. The returned forward output is tuple rather than tensor.
I must do operation on output[0] rather than output.
However, the internal code of auto attack is doing on output tensor directly. Is there an auto-attack code version to support the operation to do the execution on the output[0] rather than output? Or should I adjust the PyTorch-Version to support the auto-attack and retrain the model?
I am looking forward to your answer.
Thanks & Regards! Momo