Code Monkey home page Code Monkey logo

Comments (3)

AbhishekSanthanam avatar AbhishekSanthanam commented on May 21, 2024

Facing the same error

from gpt-2-tensorflow2.0.

tkahn avatar tkahn commented on May 21, 2024

I'm having the same issue.
Just like @Carterbouley, I ran the preprocessing and the training and everything went fine.
But when I start the sample sequence I get this error (after 30 seconds or so):

run sequence_generator.py
Model weights loaded into memory
Traceback (most recent call last):

  File "G:\Repos\gpt-2-tensorflow2.0\sequence_generator.py", line 28, in <module>
    seq_gen()

  File "G:\Python\Anaconda3\lib\site-packages\click\core.py", line 1128, in __call__
    return self.main(*args, **kwargs)

  File "G:\Python\Anaconda3\lib\site-packages\click\core.py", line 1053, in main
    rv = self.invoke(ctx)

  File "G:\Python\Anaconda3\lib\site-packages\click\core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)

  File "G:\Python\Anaconda3\lib\site-packages\click\core.py", line 754, in invoke
    return __callback(*args, **kwargs)

  File "G:\Repos\gpt-2-tensorflow2.0\sequence_generator.py", line 18, in seq_gen
    generated_seq = sg.sample_sequence(context,

  File "G:\Repos\gpt-2-tensorflow2.0\sample.py", line 117, in sample_sequence
    generated_seq = self.sp.decode_ids(pred[1:])

  File "G:\Python\Anaconda3\lib\site-packages\sentencepiece\__init__.py", line 174, in DecodeIdsWithCheck
    return _sentencepiece.SentencePieceProcessor_DecodeIdsWithCheck(self, ids)

IndexError: Out of range: piece id is out of range.

As you can see from the traceback, I'm running the script in an Anaconda environment (Anaconda Navigator 2.1.1) using Spyder 5.1.5.

Python version 3.8.12.
Tensorflow version 2.7 (currently running on CPU because of insufficient amount of VRAM (11GB) on GPU).
Sentencepiece version 0..1.96
Windows 11

from gpt-2-tensorflow2.0.

AbuUbaida avatar AbuUbaida commented on May 21, 2024

Just like @tkahn . After training and evaluating an epoch when generating/scoring the predictions it throws the exception:

[/usr/local/lib/python3.7/dist-packages/sentencepiece/__init__.py](https://localhost:8080/#) in _func(v, n)
   1036   def _func(v, n):
   1037     if type(n) is int and (n < 0 or n >= v.piece_size()):
-> 1038       raise IndexError('piece id is out of range.')
   1039     return func(v, n)
   1040 

IndexError: piece id is out of range.

Anybody could figure it out?

from gpt-2-tensorflow2.0.

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.