Skip to content

Instantly share code, notes, and snippets.

@aryan-jadon
Created September 16, 2022 02:20
Show Gist options
  • Save aryan-jadon/7d5c6db5cab8d0bb87f7030dc8e47577 to your computer and use it in GitHub Desktop.
Save aryan-jadon/7d5c6db5cab8d0bb87f7030dc8e47577 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@wayu0730
Copy link

Hi, when I run block 11, which includes the following code:

 #raw predictions are a dictionary from which all kind of information including quantiles can be extracted
 raw_predictions, x = best_tft.predict(val_dataloader, mode="raw", return_x=True)

I encountered the following error:

INFO: LOCAL_RANK: 0 - CUDA_VISIBLE_DEVICES: [0]
INFO:lightning.pytorch.accelerators.cuda:LOCAL_RANK: 0 - CUDA_VISIBLE_DEVICES: [0]
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
[<ipython-input-17-8fadc90fabdb>](https://localhost:8080/#) in <cell line: 2>()
      1 # raw predictions are a dictionary from which all kind of information including quantiles can be extracted
----> 2 raw_predictions, x = best_tft.predict(val_dataloader, mode="raw", return_x=True)

ValueError: too many values to unpack (expected 2)

I would like to understand why this error occurred and also clarify what the assigned value of x represents.
Thank you!

@why31
Copy link

why31 commented Jan 30, 2024

Hi, when I run block 11, which includes the following code:

 #raw predictions are a dictionary from which all kind of information including quantiles can be extracted
 raw_predictions, x = best_tft.predict(val_dataloader, mode="raw", return_x=True)

I encountered the following error:

INFO: LOCAL_RANK: 0 - CUDA_VISIBLE_DEVICES: [0]
INFO:lightning.pytorch.accelerators.cuda:LOCAL_RANK: 0 - CUDA_VISIBLE_DEVICES: [0]
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
[<ipython-input-17-8fadc90fabdb>](https://localhost:8080/#) in <cell line: 2>()
      1 # raw predictions are a dictionary from which all kind of information including quantiles can be extracted
----> 2 raw_predictions, x = best_tft.predict(val_dataloader, mode="raw", return_x=True)

ValueError: too many values to unpack (expected 2)

I would like to understand why this error occurred and also clarify what the assigned value of x represents. Thank you!

try
raw_predictions, x, *anything_else = tft.predict(data=val_dataloader, mode="raw", return_x=True,return_y=True)

@viktorheli
Copy link

Hi, when I run block 11, which includes the following code:

 #raw predictions are a dictionary from which all kind of information including quantiles can be extracted
 raw_predictions, x = best_tft.predict(val_dataloader, mode="raw", return_x=True)

I encountered the following error:

INFO: LOCAL_RANK: 0 - CUDA_VISIBLE_DEVICES: [0]
INFO:lightning.pytorch.accelerators.cuda:LOCAL_RANK: 0 - CUDA_VISIBLE_DEVICES: [0]
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
[<ipython-input-17-8fadc90fabdb>](https://localhost:8080/#) in <cell line: 2>()
      1 # raw predictions are a dictionary from which all kind of information including quantiles can be extracted
----> 2 raw_predictions, x = best_tft.predict(val_dataloader, mode="raw", return_x=True)

ValueError: too many values to unpack (expected 2)

I would like to understand why this error occurred and also clarify what the assigned value of x represents. Thank you!

try raw_predictions, x, *anything_else = tft.predict(data=val_dataloader, mode="raw", return_x=True,return_y=True)

I have the same problem. I tried your solution. Does not help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment