I’ve been running into this problems for days with the Pytorch Forcasting package.
Running this code:
for idx in range(10):  # plot 10 examples
best_tft.plot_prediction(x, raw_predictions, idx=idx, add_loss_to_title=True);
I get this message:
/usr/local/lib/python3.7/dist-packages/pytorch_forecasting/models/temporal_fusion_transformer/init.py in plot_prediction(self, x, out, idx, plot_attention, add_loss_to_title, show_future_observed, ax, **kwargs)
671             show_future_observed=show_future_observed,
672             ax=ax,
 → 673             **kwargs,
674         )
675
/usr/local/lib/python3.7/dist-packages/pytorch_forecasting/models/base_model.py in plot_prediction(self, x, out, idx, add_loss_to_title, show_future_observed, ax, quantiles_kwargs, prediction_kwargs)
759         ):
760
 → 761             y_all = torch.cat([encoder_target[idx], decoder_target[idx]])
762             max_encoder_length = x[“encoder_lengths”].max()
763             y = torch.cat(
IndexError: index 1 is out of bounds for dimension 0 with size 1
I’m very new at this. If there is more information or code that is needed to trouble shoot, then please let me know. Thanks in advance.