Git Product home page Git Product logo

Comments (5)

taku910 avatar taku910 commented on May 5, 2024 7

This error happens when the input training data is too small. Could you try spm_train with larger data?

spm_train first generates the minimum vocabulary set with

  • (almost) all unique characters in the training data.
  • Substrings that have no less than two times occurrences in the corpus. These substrings will not cross word boundary (whitespaces)

For example, if the input corpus is "a b c d a b c", the minimum vocabulary set is 3. (a b and c)

spm train fails when the size of minimum vocabulary set is smaller than --vocab_size.
I will make the error message more easy-to-understand.

from sentencepiece.

taku910 avatar taku910 commented on May 5, 2024 1

I've added --hard_vocab_limit flag.
The vocab size is considered as "soft limit" when running ./spm_train --hard_vocab_limit=false.

Thank you.

from sentencepiece.

jonsafari avatar jonsafari commented on May 5, 2024

A similar thing happened to me on a 256 GB Debian 8 x64 machine with --vocab_size=16000, unigram.

from sentencepiece.

zachmayer avatar zachmayer commented on May 5, 2024

I got the same error, and fixed it by decreasing the vocab size. I think too big of a vocabulary can also generate issues when trying to save the final results.

from sentencepiece.

codeman38 avatar codeman38 commented on May 5, 2024

I feel like it would be useful to have an option which would treat vocab_size as an upper bound rather than a hard value. That is, if this option were enabled and vocab_size turns out to be too large, spm_train would fall back to the minimum vocabulary rather than aborting.

from sentencepiece.

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.