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.
https://www.reshot.ai
MIT License
981 stars 99 forks source link

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

Open kopyl opened 1 year ago

kopyl commented 1 year ago

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)