Skip to content
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

Fix error when handing over trainer_kwargs to predict_depency() #1366

Merged
merged 1 commit into from
Sep 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions pytorch_forecasting/models/base_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1473,13 +1473,14 @@ def predict_dependency(
# set values
data.set_overwrite_values(variable=variable, values=value, target=target)
# predict
kwargs.setdefault("mode", "prediction")
pred_kwargs = deepcopy(kwargs)
pred_kwargs.setdefault("mode", "prediction")

if idx == 0 and mode == "dataframe": # need index for returning as dataframe
res = self.predict(data, return_index=True, **kwargs)
res = self.predict(data, return_index=True, **pred_kwargs)
results.append(res.output)
else:
results.append(self.predict(data, **kwargs))
results.append(self.predict(data, **pred_kwargs))
# increment progress
progress_bar.update()

Expand Down
Loading