chamfer_distance icon indicating copy to clipboard operation
chamfer_distance copied to clipboard

backward doesn't work

Open vertzeran opened this issue 2 years ago • 2 comments

Hello, trying to use in an optimization procedure. Trying out the demo code

import torch from chamfer_distance import ChamferDistance import time

chamfer_dist = ChamferDistance()

p1 = torch.rand([10,25,3], requires_grad=True) p2 = torch.rand([10,15,3], requires_grad=True)

dist1, dist2, idx1, idx2 = chamfer_dist(p1,p2) loss = (torch.mean(dist1)) + (torch.mean(dist2))

then adding loss.backwad()

I get : "TypeError: backward( takes 4 positional argument but 5 were given" using torch version 1.9.1 on a linux system.

Eran

vertzeran avatar May 19 '22 06:05 vertzeran

Same for me with torch 1.8.0

YishaiEArbe avatar Sep 06 '22 14:09 YishaiEArbe

@vertzeran @YishaiEArbe Please use the latest version of the code to solve the issue.

otaheri avatar Sep 11 '22 23:09 otaheri