Skip to content

LSTNet + PyTorch cannot be trained (RuntimeError) #283

@elseml

Description

@elseml

When using an LSTNet summary network in combination with the PyTorch backend, automatic model building fails when calling approximator.fit() with the following RuntimeError:

RuntimeError: Unable to automatically build the model. Please build it yourself before calling fit/evaluate/predict. A model is 'built' when its variables have been created and its self.built attribute is True. Usually, calling the model on a batch of data is the right way to build it. Exception encountered: 'Exception encountered when calling ContinuousApproximator.call().

Model ContinuousApproximator does not have a call() method implemented.

Arguments received by ContinuousApproximator.call(): • args=({'inference_variables': 'torch.Tensor(shape=torch.Size([64, 3]), dtype=float32)', 'summary_variables': 'torch.Tensor(shape=torch.Size([64, 13, 2]), dtype=float32)', 'inference_conditions': 'torch.Tensor(shape=torch.Size([64, 1]), dtype=float32)'},) • kwargs=<class 'inspect._empty'>'

This error does not occur when one of the components is changed (e.g., either using TensorFlow as the keras backend or using another summary network such as DeepSet).

The error can be reproduced in the Linear_Regression.ipynb example by using the torch backend and replacing the DeepSet summary network with an LSTNet summary network.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions