Git Product home page Git Product logo

Comments (8)

alexandre01 avatar alexandre01 commented on August 29, 2024 1

Hello @tsaxena!
Yes unfortunately this is due to the fact that the pretrained model was trained with a maximum of 8 paths per SVG. Since an index embedding is used in the model, this means one cannot perform inference using a larger amount.

You'd need to train a model with more paths or filter your classification dataset to eight paths.

from deepsvg.

alexandre01 avatar alexandre01 commented on August 29, 2024 1

Yes, the dataset is about 100k icons, but because of time constraints the pretrained model was only trained on a filtered subset. And I don't have access to the GPU server I used anymore.

from deepsvg.

tsaxena avatar tsaxena commented on August 29, 2024

I am using the following methods to encode icon, but does seem to work on some of the icon indices.

`
def encode(data):
model_args = batchify((data[key] for key in cfg.model_args), device)
with torch.no_grad():
z = model(*model_args, encode_mode=True)
return z

def encode_icon(idx):
data = dataset.get(id=idx, random_aug=False)
return encode(data)
`

from deepsvg.

tsaxena avatar tsaxena commented on August 29, 2024

Thanks for the prompt reply @alexandre01 . So does that mean you did not use all 100k icons for training the pretrained model?

from deepsvg.

tsaxena avatar tsaxena commented on August 29, 2024

I eventually want to fine tune the network on svgs that will have more than 8 paths. Do you suggest training from scratch? From what I understand, the max number of SVG paths is a configuration parameter that can be changed.

from deepsvg.

pwichmann avatar pwichmann commented on August 29, 2024

I am not @alexandre01. But what you say is correct, I think.

The max number of paths is a config parameter and can be changed in deepsvg/model/confg.py:

self.max_num_groups = 8          # Number of paths (N_P)

There are also individual configs in configs/deepsvg/ that overwrite this variable. You may need to increase the number of paths here as well.

You would need to retrain to cope with a larger number of paths. If you have a beefy GPU, retraining does not take very long. On my RTX 3090, I can retrain from scratch within hours.

What is your use case?

from deepsvg.

hecunren avatar hecunren commented on August 29, 2024

@tsaxena ,Hi, I'm also having issues with tensor mismatches using my own svg images. I hope to be able to adjust the configuration of max_num_groups and max_total_len in this project and train the model's own max_num_groups and max_total_len to solve the problem of tensor mismatch. Unfortunately, I didn't make any progress. Have you solved this problem? Can you give me some detailed guidance? I would be infinitely grateful and look forward to hearing from you!

from deepsvg.

hecunren avatar hecunren commented on August 29, 2024

@pwichmann ,Hello, I followed the method you provided but it failed. Can you give me some detailed guidance? I would be infinitely grateful and look forward to hearing from you!

from deepsvg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.