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

Working Scikeras Classifer model now broken with scikeras 0.13. AttributeError: 'Sequential' object has no attribute 'compiled'. #323

Closed
CAW9 opened this issue Apr 17, 2024 · 7 comments

Comments

@CAW9
Copy link

CAW9 commented Apr 17, 2024

Hello. I have used scikeras in my project for a while now. I was interested in upgrading to python 3.12 and scikeras 0.13, but it appears that using scikeras 0.13 breaks my project with the following error:

estimator.fit(X_train, y_train, **fit_params)
File "scikeras/wrappers.py", line 1501, in fit
super().fit(X=X, y=y, sample_weight=sample_weight, **kwargs)
File "scikeras/wrappers.py", line 770, in fit
self._fit(
File "scikeras/wrappers.py", line 928, in _fit
self._ensure_compiled_model()
File "scikeras/wrappers.py", line 439, in ensure_compiled_model
if not self.model
.compiled:
^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Sequential' object has no attribute 'compiled'

Thank you for any help you can provide. I did check doumentation to see if there were any changes I need to make to my code to keep up to date with 0.13, but it does not appear that any have been documented.

@adriangb
Copy link
Owner

Would you mind providing a self contained reproducible example? Thanks!

@CAW9
Copy link
Author

CAW9 commented Apr 17, 2024

Absolutely, I will work that up for you.

@CAW9
Copy link
Author

CAW9 commented Apr 17, 2024

https://colab.research.google.com/drive/1-fujpU2gwur6PxTQPJvXxwG_jiDCEiLd?usp=sharing

It looks like scikeras 0.13 is not compatible with keras 2, and scikeras 0.12 is not compatible with keras 3. Is this the case?

@adriangb
Copy link
Owner

Yes. I can’t maintain compatibility with two major versions unfortunately.

@CAW9
Copy link
Author

CAW9 commented Apr 18, 2024

Thank you!

@CAW9
Copy link
Author

CAW9 commented Apr 18, 2024

No further question.

@CAW9 CAW9 closed this as completed Apr 18, 2024
@adriangb
Copy link
Owner

I'm glad we figured it out and I'm sorry about not being able to support older major versions :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants