gpt-2 icon indicating copy to clipboard operation
gpt-2 copied to clipboard

ZeroDivisionError: integer division or modulo by zero

Open MKLuff opened this issue 5 years ago • 2 comments

Hey,

I've been trying to get this to run, but keep running into an issue when I get to the training phase. I keep getting this back:

Loading checkpoint models\117M\model.ckpt Loading dataset... 100%|████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 64.01it/s] dataset has 0 tokens Training... Traceback (most recent call last): File "Desktop/Thesis_GPT2_Training/gpt-2-finetuning/src/train.py", line 297, in main() File "Desktop/Thesis_GPT2_Training/gpt-2-finetuning/src/train.py", line 275, in main feed_dict={context: sample_batch()}) File "Desktop/Thesis_GPT2_Training/gpt-2-finetuning/src/train.py", line 251, in sample_batch return [data_sampler.sample(1024) for _ in range(args.batch_size)] File "Desktop/Thesis_GPT2_Training/gpt-2-finetuning/src/train.py", line 251, in return [data_sampler.sample(1024) for _ in range(args.batch_size)] File "C:\Users\luffm\Desktop\Thesis_GPT2_Training\gpt-2-finetuning\src\load_dataset.py", line 74, in sample self.chunks ZeroDivisionError: integer division or modulo by zero

I saw someone else was able to fix this problem by increasing the the lines of text, but I've tried doing that with no luck. (I've tried running it with 1000, 4000, and 10,000 lines of text)

Has anyone else had this issue or found a way to fix it?

Thank you.

MKLuff avatar Feb 02 '20 20:02 MKLuff

It means you didn't properly load the training text.

Github is for the discussion of development not asking questions that only apply to you. Try stack exchange or some where similar to ask for help.

senorblasto avatar Feb 17 '20 03:02 senorblasto

@senorblasto with all due respect, github is for both.

It would’ve been a lot more helpful for you to attempt to actually help OP through the problem, not get into the philosophy about “what github is for”. Their question is 100% legit, and this IS the right place to ask it, IN ADDITION to SO.

THIS IS discussion about development... 🙄

OP, can you elaborate more on how you are loading the training corpus?

Jovonni avatar Feb 17 '20 13:02 Jovonni