-
Notifications
You must be signed in to change notification settings - Fork 845
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] RegressionEnsembleModel predict error #2437
Comments
Hi @GeorgeXiaojie, I don't see from darts.models import RegressionEnsembleModel, LightGBMModel, XGBModel
from darts.datasets import AirPassengersDataset
ts = AirPassengersDataset().load()
model = RegressionEnsembleModel(
forecasting_models = [
LightGBMModel(
lags=3,
output_chunk_length=1,
random_state=2022,
),
XGBModel(
lags=3,
output_chunk_length=1,
random_state=2022
)],
regression_train_n_points = 10
)
model.fit(ts)
# works
model.predict(3)
model.save("model.pt")
model_loaded = RegressionEnsembleModel.load("model.pt")
# works as well
model_loaded.predict(3) |
Thank you for your reply. There is a model.fit and I've followed up on the issue. RegressionEnsembleModel is OK using the predictive models LightGBMModel and XGBModel. However, RegressionEnsembleModel using TiDEModel and NLinearModel is not working. |
Oh thanks for the clarification, managed to reproduce the problem. It seems like the torch models weights are not being loaded properly, we will investigate this further. |
I found out that the problem comes from the Since ensemble model uses the We may need to figure out a way to save the .ckpt file of the torch model in the ensemble model. |
Thanks, looking forward to providing a solution. I've tried before to save the model directly using pickle.dump to save the model directly and then load the model using pickle.load, but I still can't get rid of the problem. |
Describe the bug
A clear and concise description of what the bug is.
scene1:as below, RegressionEnsembleModel train and predict works
train:
predict:
scene2:as bellow, RegressionEnsembleModel train works, but predict doesn't work, and raises an exception: AttributeError: 'NoneType' object has no attribute 'set_predict_parameters'
train:
predict:
I debugged into the code below and found that self.model is indeed None, I'm not sure if it's because of a bug?
To Reproduce
Steps to reproduce the behavior, preferably code snippet.
Expected behavior
A clear and concise description of what you expected to happen.
System (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: