mattsherar / Temporal_Fusion_Transform

Pytorch Implementation of Google's TFT
241 stars 60 forks source link

Hello! I meet some error when I run trainer.ipynb #1

Open hihihihiwsf opened 4 years ago

hihihihiwsf commented 4 years ago

when I run trainer.ipynb, I meet errors like followings :

image

elect = ts_dataset.TSDataset(id_col, time_col, input_cols, target_col, time_steps, max_samples, input_size, num_encoder_steps, output_size, train) will arise the error that:

image

Since the definition of TFDataset is image

It actually missed two items. I'll appreciate it very much if you would help me with this problem!

franz101 commented 4 years ago

@mattsherar great portation! I also tried to make the example available on google colab: https://colab.research.google.com/drive/1jHm47IaJ6d4NPMTpq_exkg_3jtjtLvfJ?usp=sharing Which columns need to be set for static?

lemonskiller commented 4 years ago

I met the same problem!

jbelisario commented 4 years ago

@mattsherar Same issue. From a Google created notebook implementation of the original TFT code running the traffic experiment, 'categorical_id' was set as a static input, and 'id' was set with InputTypes.ID.

image

Link to the Google notebook: https://aihub.cloud.google.com/u/0/p/products%2F9f39ad8d-ad81-4fd9-8238-5186d36db2ec

When doing the following: static_cols = 'categorical_id' num_static = 1 I get this error: ValueError: could not broadcast input array from shape (192) into shape (192,1)

Any help with this would be much appreciated.

Update the following ran without error: static_cols = ['categorical_id'] num_static = len(static_cols)

Ran into another issue but will raise a new issue for it.

fmobrj commented 4 years ago

Inspecting original TFT from google. It seems that:

static_cols =['categorical_id'] num_static = 1