Skip to content

RuntimeError: Can't call numpy() on Tensor that requires grad. Use tensor.detach().numpy() instead. #37

@kopyl

Description

@kopyl

When i run this:

img_list = []

for i in range(150):
    optimizer.zero_grad()

    p_pred = svg_pred.sample_points()
    l = svg_emd_loss(p_pred, p_target)
    l.backward()
    optimizer.step()
    
    if i % 4 == 0:
        img = svg_pred.draw(wiath_points=True, do_display=False, return_png=True)
        img_list.append(img)
            
to_gif(img_list)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions