question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

tft unable to set target to a list of strings (multiple targets)

See original GitHub issue
  • PyTorch-Forecasting version: 0.8.5
  • PyTorch version: 1.8.1
  • Python version: 3.8.10
  • Operating System: linux 3.10.0-1160.25.1.el7.x86_64

according to doc: https://pytorch-forecasting.readthedocs.io/en/latest/api/pytorch_forecasting.data.timeseries.TimeSeriesDataSet.html the target parameter can be set to a list of strings indicating multiple variables for prediction However, during run time, the code spits the following error:

TypeError: new() received an invalid combination of arguments - got (list, int), but expected one of:
 * (*, torch.device device)
      didn't match because some of the arguments have invalid types: (list, int)
 * (torch.Storage storage)
 * (Tensor other)
 * (tuple of ints size, *, torch.device device)
 * (object data, *, torch.device device)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:18 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
LumingSuncommented, Oct 29, 2021

Hi! I encountered the similar issue when trying to define MultiLoss as

I tried several setups: pytorch_forecasting 0.9.0 pytorch_lightning 1.4.2 pytorch 1.9.0 python 3.7.11 linux 18.04.5 pytorch_forecasting 0.9.1 pytorch_lightning 1.4.9 pytorch 1.8.0 python 3.8.12 linux 18.04.5

When I try to initialize the loss as loss=MultiLoss([QuantileLoss(), QuantileLoss(), QuantileLoss(), QuantileLoss(), QuantileLoss(), QuantileLoss()]) I encountered TypeError: ‘int’ object is not iterable while initializing the TFT.

How did you solve this issue @jdb78 @QitianMa?

Thank you!

@owoshch I encountered this problem when I only set loss with multiple loss but forgot to set the output_size to a list of output sizes.

But even if the loss and output_size are set correctly and the learning rate is a small value, I still have the same issue as @QitianMa . Output before the error message:

Validation sanity check:   0%|          | 0/1 [00:00<?, ?it/s]/Users/bytedance/opt/anaconda3/envs/pythonProject/lib/python3.8/site-packages/pytorch_forecasting/metrics.py:555: UserWarning: Loss is not finite. Resetting it to 1e9
  warnings.warn("Loss is not finite. Resetting it to 1e9")
Epoch 0:   0%|          | 0/166 [00:00<?, ?it/s]/Users/bytedance/opt/anaconda3/envs/pythonProject/lib/python3.8/site-packages/pytorch_forecasting/metrics.py:555: UserWarning: Loss is not finite. Resetting it to 1e9
  warnings.warn("Loss is not finite. Resetting it to 1e9")
Epoch 0:   0%|          | 0/166 [00:08<?, ?it/s]
1reaction
QitianMacommented, Jun 12, 2021

Guess this does not happen immediately, right? It is most likely divergence leading to a nan without a grad. So probably a too high learning rate or you need to clip your gradients at a lower value.

This happens immediately. I tried gradient_clip_val=0.0001, and learning rate 1e-6. This issue persists.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Swift Class for multiple targets can't compile when calling ...
Now I'm facing a problem where I call an API that's available on one target but not on the other. I don't care...
Read more >
TimeSeriesDataSet — pytorch-forecasting documentation
Minimum number of time steps variables are lagged. If dataset encodes one or multiple targets. Continous variables as used for modelling. List of...
Read more >
Shadowed Unit Frames Set Up Guide - YouTube
Shadowed Unit Frames Is the BEST WoW addon to customize your UI. Full addon setup guide for a Clean World of Warcraft UI...
Read more >
[9.2.5] Bajheera Threat Plates Settings (Nameplate ... - YouTube
... to LIKE / COMMENT & SUBSCRIBE (Enable Notifications!) Merry Christmas, Happy Holidays & thanks for watching :) … Show more. Show more...
Read more >
Use PXE for OSD over the network - Configuration Manager
When you create an OS deployment that targets only x64 BIOS computers, ... For more information, see Install or modify a distribution point....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found