You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File [/opt/homebrew/Caskroom/mambaforge/base/envs/SEAM/lib/python3.11/site-packages/scikeras/wrappers.py:549](https://file+.vscode-resource.vscode-cdn.net/opt/homebrew/Caskroom/mambaforge/base/envs/SEAM/lib/python3.11/site-packages/scikeras/wrappers.py:549), in BaseWrapper._check_model_compatibility(self, y)
544 # check if this is a multi-output model
545 if getattr(self, "n_outputs_expected_", None):
546 # n_outputs_expected_ is generated by data transformers
547 # we recognize the attribute but do not force it to be
548 # generated
--> 549 if self.n_outputs_expected_ != len(self.model_.outputs):
550 raise ValueError(
551 "Detected a Keras model input of size"
552 f" {self.n_outputs_expected_ }, but {self.model_} has"
553 f" {len(self.model_.outputs)} outputs"
554 )
555 # check that if the user gave us a loss function it ended up in
556 # the actual model
TypeError: object of type 'NoneType' has no len()
Any thoughts on how to fix this? It seems that models instantiated with the functional API (keras.Model(inputs, outputs)) do not have the same outputs attribute as those created from user-defined classes which inherit from keras.Model, which possibly explains this error.
The text was updated successfully, but these errors were encountered:
Hey there,
I have tried to use
scikeras
with a custom class inheritingkeras.Model
, but unfortunately this seems to fail.Here is MWE:
which throws
Any thoughts on how to fix this? It seems that models instantiated with the functional API (
keras.Model(inputs, outputs)
) do not have the sameoutputs
attribute as those created from user-defined classes which inherit fromkeras.Model
, which possibly explains this error.The text was updated successfully, but these errors were encountered: