Closed samo313 closed 4 years ago
Are you running the original code? I run it by myself and this problem didn't occur. I'm using torch 1.2 and python3.6. Normally, this problem is because the image Tensor has been calculated gradient in the computational graphs. While it requires the tensor to be a leave node, which is a new tensor without any other operations. Check whether this tensor 'image' have been modified before you running deepcopy().
your help would be much help
On Sat, Oct 31, 2020 at 10:22 PM Yaxin Li notifications@github.com wrote:
Are you running the original code? I run it by myself and this problem didn't occur. I'm using torch 1.2 and python3.6. Normally, this problem is because the image Tensor has been calculated gradient in the computational graphs. While it requires the tensor to be a leave node, which is a new tensor without any other operations. Check whether this tensor 'image' have been modified before you running deepcopy().
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/DSE-MSU/DeepRobust/issues/37#issuecomment-719973153, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIIZWMLY5O5D7EXREWREA7TSNRMFXANCNFSM4S7L6XKA .
-- پاینده باشید
https://github.com/DSE-MSU/DeepRobust/blob/9ba3751f33f87d0eda281497ce84aa99fe1f2206/examples/image/test_deepfool.py#L45
RuntimeError: Only Tensors created explicitly by the user (graph leaves) support the deepcopy protocol at the moment
x = copy.deepcopy(image).requiresgrad(True)
how can I handle it?