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

TypeError: Cannot clone object '<keras.engine.sequential.Sequential #2

Open
aloysiusunikl opened this issue Nov 9, 2020 · 0 comments

Comments

@aloysiusunikl
Copy link

I am trying to run the code: PNN_Solar_model.py
(version used: python 3.6, tensorflow 1.15.0, scikit-learn 0.20.1)
The code runs at all important sections, except at end.
I am getting an error at the last section for tuning the ANN (message shown below)
I have tried a few versions of scikit-learn, down from 0.21.2
Which version of scikit-learn is used successfully?
Thank you

Error message
File "/home/mfihvac/.config/spyder-py3/temp.py", line 147, in
grid_result = grid_search.fit(X_train, np.argmax(y_train, axis=1))
File "/home/mfihvac/anaconda3/envs/fddtest2/lib/python3.6/site-packages/sklearn/model_selection/_search.py", line 677, in fit
base_estimator = clone(self.estimator)
File "/home/mfihvac/anaconda3/envs/fddtest2/lib/python3.6/site-packages/sklearn/base.py", line 58, in clone
% (repr(estimator), type(estimator)))
TypeError: Cannot clone object '<keras.engine.sequential.Sequential object at 0x7f0cb83ebe48>' (type <class 'keras.engine.sequential.Sequential'>): it does not seem to be a scikit-learn estimator as it does not implement a 'get_params' methods.

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

1 participant