Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error is returned when SVG is processed #46

Open
paczyg opened this issue Oct 29, 2024 · 0 comments
Open

Error is returned when SVG is processed #46

paczyg opened this issue Oct 29, 2024 · 0 comments

Comments

@paczyg
Copy link

paczyg commented Oct 29, 2024

Dear All,

I have been trying to use the pretrained DeepSVG, right now to simply have the original SVG returned.
For a simple SVG, it works well.

However, when I try to use a simple SVG returned by potrace, I receive an error.
The error:
` 195 res[arg] = torch.stack([t.get_relative_args() for t in t_list])
196 if arg_ == "args":
--> 197 res[arg] = torch.stack([t.args() for t in t_list])
199 if "filling" in model_args:
200 res["filling"] = torch.stack([torch.tensor(t.filling) for t in t_sep]).unsqueeze(-1)

RuntimeError: stack expects each tensor to be equal size, but got [72, 11] at entry 0 and [67, 11] at entry 1`

Here is the code of the SVG (with bad xml tags to have it showed well here:

<.?xml version="1.0" standalone="no"?>
<.!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<.svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="256.000000pt" height="256.000000pt" viewBox="0 0 256.000000 256.000000"
preserveAspectRatio="xMidYMid meet">
<.metadata>
Created by potrace 1.16, written by Peter Selinger 2001-2019
<./metadata>
<.g transform="translate(0.000000,256.000000) scale(0.100000,-0.100000)"
fill="#000000" stroke="none">
<.path d="M995 2228 c-3 -7 -4 -440 -3 -963 l3 -950 313 -3 312 -2 0 965 0 965
-310 0 c-239 0 -312 -3 -315 -12z m613 -955 l-3 -948 -297 -3 -298 -2 0 950 0
950 300 0 300 0 -2 -947z"/>
<./g>
<./svg>

Can you help me with this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant