diff --git a/CHANGELOG.md b/CHANGELOG.md index 43dd6097a1..f8cc8447d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -52,6 +52,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Fixed a bug where additional `DataModule` keyword arguments could not be configured with Flash Zero for some tasks ([#994](https://github.com/PyTorchLightning/lightning-flash/pull/994)) +- Fixed a bug where the TabularForecaster would not work with some versions of pandas ([#995](https://github.com/PyTorchLightning/lightning-flash/pull/995)) + ### Removed - Removed `OutputMapping` ([#939](https://github.com/PyTorchLightning/lightning-flash/pull/939)) diff --git a/flash/core/integrations/pytorch_forecasting/adapter.py b/flash/core/integrations/pytorch_forecasting/adapter.py index 69da066074..57068b3716 100644 --- a/flash/core/integrations/pytorch_forecasting/adapter.py +++ b/flash/core/integrations/pytorch_forecasting/adapter.py @@ -76,7 +76,7 @@ def from_task( ) -> Adapter: parameters = copy(parameters) # Remove the single row of data from the parameters to reconstruct the `time_series_dataset` - data = parameters.pop("data_sample") + data = DataFrame.from_dict(parameters.pop("data_sample")) time_series_dataset = PatchTimeSeriesDataSet.from_parameters(parameters, data) backbone_kwargs["loss"] = loss_fn diff --git a/flash/tabular/forecasting/data.py b/flash/tabular/forecasting/data.py index d9ad146360..a10ae91c01 100644 --- a/flash/tabular/forecasting/data.py +++ b/flash/tabular/forecasting/data.py @@ -62,7 +62,7 @@ def load_data( parameters = time_series_dataset.get_parameters() # Add some sample data so that we can recreate the `TimeSeriesDataSet` later on - parameters["data_sample"] = data.iloc[[0]] + parameters["data_sample"] = data.iloc[[0]].to_dict() self.set_state(TimeSeriesDataSetParametersState(parameters)) self.parameters = parameters diff --git a/flash/tabular/forecasting/model.py b/flash/tabular/forecasting/model.py index a695e2c6ab..540abc3880 100644 --- a/flash/tabular/forecasting/model.py +++ b/flash/tabular/forecasting/model.py @@ -37,7 +37,7 @@ def __init__( metrics: Union[torchmetrics.Metric, List[torchmetrics.Metric]] = None, learning_rate: float = 4e-3, ): - self.save_hyperparameters(ignore="parameters") + self.save_hyperparameters() if backbone_kwargs is None: backbone_kwargs = {}