You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Greetings,
I adapted your code in ''pure'' pytorch and replaced the calls to cv2 by calls to PIL.
In doing so, I bumped into what could cause an issue in the original code (though I did never run the original code, so maybe it does not), in the hook, I believe that: self.features = torch.tensor(output,requires_grad=True).cuda()
could actually break the backward of the loss.
Replacing it by: self.features = output
did solve the problem.
A detail that could be nice to change would be to add the picture used in the Calculate... notebook in the "pictures" directory and modify the corresponding call: picture = PIL.Image.open("test/206px-Wattledcranethumb.jpg")
PS: Thank you very much for your post on towardsdatascience and the associated code.
The text was updated successfully, but these errors were encountered:
Greetings,
I adapted your code in ''pure'' pytorch and replaced the calls to cv2 by calls to PIL.
In doing so, I bumped into what could cause an issue in the original code (though I did never run the original code, so maybe it does not), in the hook, I believe that:
self.features = torch.tensor(output,requires_grad=True).cuda()
could actually break the backward of the loss.
Replacing it by:
self.features = output
did solve the problem.
A detail that could be nice to change would be to add the picture used in the Calculate... notebook in the "pictures" directory and modify the corresponding call:
picture = PIL.Image.open("test/206px-Wattledcranethumb.jpg")
PS: Thank you very much for your post on towardsdatascience and the associated code.
The text was updated successfully, but these errors were encountered: