-
Notifications
You must be signed in to change notification settings - Fork 550
[BUG] Always crashes after around the 15th reply #68
Comments
To confirm, you are running with CUDA on your GTX 970? If you are running via CPU, 16 GB should be plenty. |
I don't know how to check which it is, but I don't think I have CUDA installed, since I remember removing a CUDA package in the past cause it was 4 GB alone, so probably CPU |
Do you get a bunch of warnings when you start the script? |
No everything is normal |
Well just in case I installed CUDA from the official repos, rebooted my PC, but it still crashed on the 15th reply with this log
|
I'm having the same issue, I'm instead using the offical online version on Google Colaboratory. |
It looks like I submitted the same bug (#75) I'm pretty sure what is causing it is too long of an input to GPT-2. Once it gets beyond 1024 tokens in one input, it crashes. The relevant line is here: |
But then how do longer stories exist? Cause I have seen stories much longer than my own. Also I tried to make another story just to see how far I would get just by writing nothing. Here's the entire terminal output since starting the game:
P.S. It froze on the last line but that's probably cause I used direct speech. |
On colab I'm on a seemingly infinite story. On 50+ responses now |
So the model only processes the last 8 action-result pairs. It would make sense that a bunch of short responses wouldn't trigger, since the model never sees them all at once. But if the last 8 are over the limit, then that would trigger a crash |
Seems like you could measure the length and cut the number of action-result pairs to fit? |
Where is the value 8 set? I'd like to experiment with changing it to see if that fixes the problem. |
In story_manger.py: |
Wouldn't lowering this number however reduce the quality of the AI responses? EDIT: Anyways I reduced it to |
you would have to retrain GPT-2 Large in order to have more than 1024 tokens. That's not something anyone but a large company could do. I also reduced the memory from 20 and it seemed to help. |
@JamesHutchison I think the cutting would be the good way to avoid crashes. I'm doing similar thing in my GPT-2 mariadb version with parameters. Output length set to negative value like -96 will produce exactly this many output tokens and read 1024 - 96 input tokens cutting the beginning part of the input to fit that amount thus to never exceed 1024 tokens total (-128 will process the input as 1024 - 128 and so on). However, I don't use any intelligent sentence detection for that which sometimes results in input having cut sentence in half at the beginning (after the beginning part of the input being cut to not crash) - optimal would maybe be to also get rid of cut sentence. Best would be for algorithm to just get rid of the most meaningless for the story actions/responses, but... Anything could have the potential to turn into something significant later. |
Is there a way to do this on browser? For me and others who come to this post for an answer to this problem in the future? |
Don't you need to have the game's files in your Google drive to play through the browser? I think you can just download the story manager file, edit it, and upload it again |
To learn how to do that, see the link below: https://colab.research.google.com/notebooks/io.ipynb#scrollTo=BaCkyg5CV5jF |
You don’t need to download to google drive just to edit the code. The |
I was having the same issue and setting self.memory to 14 fixed it for me. |
Edit: running the current version from this codebase not from a fork running locally on my machine. no google drive or such. i forgot to mention it in the original post. i have also encountered the same problem. i may not be versed in python but may ai throw a possible solution and if it is unfesable, naive or simply wrong please do tell me. from what i can gather the problem is having token's that are too long for tensorflow. so would doing a check before running trough tensorflow and checking if the token size would go over 1024 be possible? if it is possible to check then having the system test the current self memory value minus one and retest if that value is over the limit and repeat until it is under the limit so the system can kinda auto adjust the value so that it does not crash. and this would also make it possible to go in reverse if the new value is not kept between run's so that after each user input this could run before generation and thus have a dynamically adjusted value so as to not overflow and keep the maximum memory value given the user's usage and inputs. if this approach is impossible for any reason then please excuse my ignorance. |
I haven't hit this myself, well not quite, I might of, but I'm currently exactly on command 20, and it's starting to do other weirdness, namely, for example
...Yeah, I think the AI just hemoraged hard A legit one that just happened. than the Ape. You are taller than the Ape. You are taller than the Ape. You . You are the Ape. You are the Ape. You are the Ape. You are the Ape. You are |
This could be a code correctness problem (buffer overflow or improper bounds checking), not an out-of-memory problem. See bug #251. |
Describe the bug
The game always crashes around reply number 15-20, no matter what I write, even if I enter a blank reply (technically if I leave a blank reply the game comes up with a reply for me and THEN it crashes)
To Reproduce
Steps to reproduce the behavior:
Expected behavior
No crashing
Additional context
The text was updated successfully, but these errors were encountered: