keras-team / autokeras

AutoML library for deep learning
http://autokeras.com/
Apache License 2.0
9.13k stars 1.4k forks source link

_build_wrapper() got an unexpected keyword argument 'inputs' #827

Closed augustodelscenario closed 4 years ago

augustodelscenario commented 4 years ago

Bug Description

I`m trying to run example with mnist but got error.

Code

import autokeras as ak from tensorflow.python.keras.datasets import mnist import numpy as np (x_train, y_train), (x_test, y_test) = mnist.load_data() data_slice = 50 x_train = x_train[:data_slice] y_train = y_train[:data_slice] x_test = x_test[:data_slice] y_test = y_test[:data_slice] x_train = x_train.astype(np.float64) x_test = x_test.astype(np.float64) if len(np.shape(x_train)) == 3: x_train = x_train.reshape(x_train.shape + (1,)) x_test = x_test.reshape(x_test.shape + (1,)) clf = ak.ImageClassifier(max_trials=3) clf.fit(x_train, y_train, validation_data=(x_test, y_test)) y = clf.predict(x_test, y_test)

Error

Traceback (most recent call last): File "/home/scrambler/pycharm/autokeras_1/test_1.py", line 20, in clf.fit(x_train, y_train, validation_data=(x_test, y_test)) File "/home/scrambler/pycharm/autokeras_1/venv/lib/python3.6/site-packages/autokeras/auto_model.py", line 123, in fit preprocess_graph, keras_graph = self.hyper_graph.build_graphs(hp) File "/home/scrambler/pycharm/autokeras_1/venv/lib/python3.6/site-packages/autokeras/hypermodel/graph.py", line 434, in build_graphs plain_graph = self.hyper_build(hp) File "/home/scrambler/pycharm/autokeras_1/venv/lib/python3.6/site-packages/autokeras/hypermodel/graph.py", line 454, in hyper_build outputs = old_block.build(hp, inputs=inputs) TypeError: _build_wrapper() got an unexpected keyword argument 'inputs'

Setup Details

I have old computer with no AVX, so i used compiled tensorflow whl from here: https://github.com/yaroslavvb/tensorflow-community-wheels/issues/113

here is my venv: Keras 2.3.1 Keras-Applications 1.0.8 Keras-Preprocessing 1.1.0 Markdown 3.1.1
PyYAML 5.1.2
Werkzeug 0.16.0 absl-py 0.8.1
astor 0.8.0
autokeras 1.0.0a0 cachetools 3.1.1
certifi 2019.9.11
chardet 3.0.4
colorama 0.4.1
gast 0.2.2
google-auth 1.7.0 google-auth-oauthlib 0.4.1
google-pasta 0.1.8
grpcio 1.25.0
h5py 2.10.0
idna 2.8 joblib 0.14.0
keras-tuner 1.0.0 lightgbm 2.3.0
mock 3.0.5
numpy 1.17.3
oauthlib 3.1.0
opt-einsum 3.1.0 pandas 0.25.3
pip 19.0.3
protobuf 3.10.0
psutil 5.6.5
pyasn1 0.4.7
pyasn1-modules 0.2.7 python-dateutil 2.8.1 pytz 2019.3
requests 2.22.0 requests-oauthlib 1.3.0 rsa 4.0 scikit-learn 0.21.3
scipy 1.3.1
setuptools 41.6.0
six 1.13.0
tabulate 0.8.5 tb-nightly 1.14.0a20190603 tensorflow 2.0.0b1 termcolor 1.1.0
terminaltables 3.1.0
tf-estimator-nightly 1.14.0.dev2019060501
tqdm 4.37.0
urllib3 1.25.6
wheel 0.33.6
wrapt 1.11.2

swenkel commented 4 years ago

I can confirm this bug using

additionally, I had to use clf.fit(...) with validation_split to avoid raising another exception.

yz-zest commented 4 years ago

I got this error too when simply running the example IO API codes here https://autokeras.com/tutorial/

szetakyu commented 4 years ago

Same for running the auto keras 1.0 task api example with validation_split = True added on win10

TreeKat71 commented 4 years ago

Hi guys, I encountered this situation as well and I found autokeras use keras-tuner as part of it. In the master branch, keras-tuner just fixed it. SO you can fixed by install it from master. pip install git+git://github.com/keras-team/keras-tuner@master#egg=kerastuner It just a workaround if you want to run the example, it may encounter other unknown bugs so don't use in production.

bestpredicts commented 4 years ago

same probleam

YongHuangSJTU commented 4 years ago

Hi guys, I encountered this situation as well and I found autokeras use keras-tuner as part of it. In the master branch, keras-tuner just fixed it. SO you can fixed by install it from master. pip install git+git://github.com/keras-team/keras-tuner@master#egg=kerastuner It just a workaround if you want to run the example, it may encounter other unknown bugs so don't use in production.

Hi @TreeKat71 , I got the same error and couldn't fix it with your workaround. I'm using tensorflow->gpu==2.0.0b1

The error was gone after reinstall kerastuner by pip install git+git://github.com/keras-team/keras-tuner@master#egg=kerastuner Thanks TreeKat71 for your solution.

TreeKat71 commented 4 years ago

Hi @YongHuangSJTU Please report it with your environment, packages with version, and error messages. Then others can help you.

zhanghanbin3159 commented 4 years ago

Hi guys, I encountered this situation as well and I found autokeras use keras-tuner as part of it. In the master branch, keras-tuner just fixed it. SO you can fixed by install it from master. pip install git+git://github.com/keras-team/keras-tuner@master#egg=kerastuner It just a workaround if you want to run the example, it may encounter other unknown bugs so don't use in production.

solve the problem!! thanks

haifeng-jin commented 4 years ago

It should be solved in the latest released version of AutoKeras.