Pytorch forecasting CPUDispatcher error

Hi guys,
I need help!

I have been trying to use pytorch_forecasting with a script of mine and I keep getting the same error when calling the TimeSeriesDataSet function from python_forecasting:

SystemError: CPUDispatcher(<function _find_end_indices at 0x0000012AD9E7FAF8>) returned a result with an error set

After spending a while questioning all the ins and outs of my script, I simply used the generic code available online that is supposed to work, and I am still getting the same error.

Any idea of why pytorch forecasting is triggering that error for me ?

Thanks!

Below is full error, as well as the simple generic code that still does not work:

full error

File “…\anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py”, line 827, in runfile
execfile(filename, namespace)

File “…\anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py”, line 110, in execfile
exec(compile(f.read(), filename, ‘exec’), namespace)

File “generictest.py”, line 32, in
time_varying_unknown_reals=[“value”],

File “…\anaconda3\lib\site-packages\pytorch_forecasting\data\timeseries.py”, line 439, in init
self.index = self._construct_index(data, predict_mode=predict_mode)

File “…\anaconda3\lib\site-packages\pytorch_forecasting\data\timeseries.py”, line 1200, in _construct_index
min_length=min_sequence_length,

SystemError: CPUDispatcher(<function _find_end_indices at 0x0000012AD9E7FAF8>) returned a result with an error set

generic code:
import numpy as np
import pandas as pd

test_data = pd.DataFrame(
dict(
value=np.random.rand(30) - 0.5,
group=np.repeat(np.arange(3), 10),
time_idx=np.tile(np.arange(10), 3),
)
)
test_data

from pytorch_forecasting import TimeSeriesDataSet

dataset = TimeSeriesDataSet(
test_data,
group_ids=[“group”],
target=“value”,
time_idx=“time_idx”,
min_encoder_length=5,
max_encoder_length=5,
min_prediction_length=2,
max_prediction_length=2,
time_varying_unknown_reals=[“value”],
)

In case that helps, I have tried on a different machine and the error is not being raised. It seems to me that this has to do with some restrictions done by the admin of the machine.

Still not sure on how to resolve this without admin rights but hope that helps anybody looking this up.

Maybe you are hitting the same error as described here in the repository.
Could you check if using the mentioned numpy and pandas versions would work?

I guess I do owe some apologies to my admin after all :slight_smile: , you are right it has to do with pandas and numpy versions.

Note: you do need a version >= pandas 1.3.0 for pytorch-forecasting to work.

I ended up settling for pandas 1.3.1 and numpy 1.19.3

thanks for your help!