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
skops io seems to work fine with scikeras models when they haven't been fit, but not when they've been fit. The error message (and potentially underlying cause) is the same as #184
Example code (this works):
from tensorflow import keras
from sklearn.pipeline import Pipeline
from skops.io import dump
from scikeras.wrappers import KerasClassifier
# This simplifies the basic usage tutorial from https://adriangb.com/scikeras/stable/notebooks/Basic_Usage.html
def get_clf(meta):
n_features_in_ = meta["n_features_in_"]
model = keras.models.Sequential()
model.add(keras.layers.Input(shape=(n_features_in_,)))
model.add(keras.layers.Dense(1, activation="sigmoid"))
return model
clf = KerasClassifier(
model=get_clf,
loss="binary_crossentropy"
)
pipeline = Pipeline(
[("classifier", clf)]
)
# These both work
dump(clf, 'keras-test.skops')
dump(pipeline, 'keras-test.skops')
However, running the following then gives a "RecursionError: maximum recursion depth exceeded" on the last line:
import numpy as np
from sklearn.datasets import make_classification
X, y = make_classification(1000, 20, n_informative=10, random_state=0)
clf.fit(X, y)
dump(clf, 'keras-test.skops')
The text was updated successfully, but these errors were encountered:
skops io seems to work fine with scikeras models when they haven't been fit, but not when they've been fit. The error message (and potentially underlying cause) is the same as #184
Example code (this works):
However, running the following then gives a "RecursionError: maximum recursion depth exceeded" on the last line:
The text was updated successfully, but these errors were encountered: