alexandre01 / deepsvg

[NeurIPS 2020] Official code for the paper "DeepSVG: A Hierarchical Generative Network for Vector Graphics Animation". Includes a PyTorch library for deep learning with SVG data.

Home Page:https://www.lingosub.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

kopyl opened this issue · comments

commented

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)