Apr-05-2021, 08:28 PM
(This post was last modified: Apr-05-2021, 10:23 PM by Larz60+.
Edit Reason: fixed bbcode tags
)
The following simple 13 lines python 3.6.3 code gives me an error as shown. I am working in Windows 10-home. It is on the 8th line.
Thanks in advance.
Respectfully,
LZ
from keras.datasets import mnist from autokeras import ImageClassifier (x_train, y_train), (x_test, y_test) = mnist.load_data() x_train = x_train.reshape(x_train.shape + (1,)) x_test = x_test.reshape(x_test.shape + (1,)) clf = ImageClassifier(verbose=True) clf.fit(x_train, y_train, time_limit=12 * 60) clf.final_fit(x_train, y_train, x_test, y_test, retrain=True) y = clf.evaluate(x_test, y_test) print(y) clf.load_searcher().load_best_model().produce_keras_model().save(r'C:\Users\12394\PycharmProjects\Auto-keras\my_model.h5')
Error:---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-3-4c010845f357> in <module>
6 x_test = x_test.reshape(x_test.shape + (1,))
7
----> 8 clf = ImageClassifier(verbose=True)
9 clf.fit(x_train, y_train, time_limit=12 * 60)
10 clf.final_fit(x_train, y_train, x_test, y_test, retrain=True)
~\miniconda3\envs\Autokeras\lib\site-packages\autokeras\tasks\image.py in __init__(self, num_classes, multi_label, loss, metrics, project_name, max_trials, directory, objective, tuner, overwrite, seed, max_model_size, **kwargs)
102 seed=seed,
103 max_model_size=max_model_size,
--> 104 **kwargs
105 )
106
~\miniconda3\envs\Autokeras\lib\site-packages\autokeras\tasks\image.py in __init__(self, outputs, **kwargs)
33 class SupervisedImagePipeline(auto_model.AutoModel):
34 def __init__(self, outputs, **kwargs):
---> 35 super().__init__(inputs=input_module.ImageInput(), outputs=outputs, **kwargs)
36
37
~\miniconda3\envs\Autokeras\lib\site-packages\autokeras\auto_model.py in __init__(self, inputs, outputs, project_name, max_trials, directory, objective, tuner, overwrite, seed, max_model_size, **kwargs)
149 project_name=project_name,
150 max_model_size=max_model_size,
--> 151 **kwargs
152 )
153 self.overwrite = overwrite
~\miniconda3\envs\Autokeras\lib\site-packages\autokeras\tuners\task_specific.py in __init__(self, **kwargs)
155 class ImageClassifierTuner(greedy.Greedy):
156 def __init__(self, **kwargs):
--> 157 super().__init__(initial_hps=IMAGE_CLASSIFIER, **kwargs)
158
159
~\miniconda3\envs\Autokeras\lib\site-packages\autokeras\tuners\greedy.py in __init__(self, hypermodel, objective, max_trials, initial_hps, seed, hyperparameters, tune_new_entries, allow_new_entries, **kwargs)
228 allow_new_entries=allow_new_entries,
229 )
--> 230 super().__init__(oracle=oracle, hypermodel=hypermodel, **kwargs)
~\miniconda3\envs\Autokeras\lib\site-packages\autokeras\engine\tuner.py in __init__(self, oracle, hypermodel, **kwargs)
50 # Initialize before super() for reload to work.
51 self._finished = False
---> 52 super().__init__(oracle, hypermodel, **kwargs)
53 # Save or load the HyperModel.
54 self.hypermodel.hypermodel.save(os.path.join(self.project_dir, "graph"))
TypeError: __init__() got an unexpected keyword argument 'verbose'
How do I get rid of this error? I googled the error and got many responses and none of them I understand. Thanks in advance.
Respectfully,
LZ