Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when I provide test dataset (custom minGPT) #59

Open
asigalov61 opened this issue Mar 22, 2021 · 0 comments
Open

Error when I provide test dataset (custom minGPT) #59

asigalov61 opened this issue Mar 22, 2021 · 0 comments

Comments

@asigalov61
Copy link

asigalov61 commented Mar 22, 2021

@karpathy and other contributors

Hey guys,

I am loving your implementation. It's awesome, but I am getting an error when I try to use a test dataset during training with custom minGPT and play_char code.

I use a slightly modified minGPT and modified version of play_char notebook, so the problem may be on my end, but I could really use some help to narrowing down the problem because I can't fix it for some reason.

Here is what I get:

epoch 1 iter 305: train loss 1.24552. lr 6.000000e-04: 100%|██████████| 306/306 [01:46<00:00,  2.87it/s]
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-3-78d9c7cbef4b> in <module>()
      1 #@title (OPTION 1) Train the model
      2 get_ipython().magic('cd /content/')
----> 3 trainer.train()

1 frames
/content/tegridy-tools/tegridy-tools/minGPT.py in train(self)
    373             run_epoch('train')
    374             if self.test_dataset is not None:
--> 375                 test_loss = run_epoch('test')
    376 
    377             # supports early stopping based on the test loss, or just save always if no test set is provided

/content/tegridy-tools/tegridy-tools/minGPT.py in run_epoch(split)
    321             losses = []
    322             pbar = tqdm(enumerate(loader), total=len(loader)) if is_train else enumerate(loader)
--> 323             for it, (x, y) in pbar:
    324 
    325                 # place data on the correct device

ValueError: too many values to unpack (expected 2)

If someone can take a look at the code/notebook, I would really appreciate it.

Here is my version of minGPT and the notebook:

https://github.com/asigalov61/tegridy-tools/blob/main/tegridy-tools/minGPT.py

https://colab.research.google.com/drive/1erZa6Wk4Tvm1bHet2_BQ3Qk3ALHpi6Ix?usp=sharing

Thank you in advance for your time and help with this issue.

Alex

P.S. I thought it was related to my tqdm.auto.tqdm statement, but it gives a similar error. So it's not tqdm IMHO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant