Python Forum
Unexpected parameter verbose
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unexpected parameter verbose
#1
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.


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
Reply
#2
(Apr-05-2021, 08:28 PM)Led_Zeppelin Wrote: clf = ImageClassifier(verbose=True)
Does "ImageClassifier()" recognize a "verbose" argument? I don't see it in the manual. See ImageClassifier.
buran likes this post
Reply
#3
In regards to the above post about unexpected keyword argument verbose, I have a basic Autokeras question and it might be the solution to this error.

I have several recent documents on Autokeras that state that it is only compatible with Python 3.6. Is this true?

If so it would explain an awful lot about the error above. I am using a Python version that is 3.7 or higher and that could explain a lot.

The question is Autokeras (it does not state any version) compatible only with Python 3.6?


R,

LZ
Reply
#4
The Autokeras website (https://autokeras.com/) suggests 3.5 is the minimum version.

Having said that, the error won't be anything to do with the Python version itself. As mentioned, check the docs for that class to see what the valid parameters are.
Reply
#5
But verbose is a valid argument or parameter to ImageClassifier. I have seen it used with Imageclassifier many times.

So why is my case different?

Respectfully,

LZ
Reply
#6
I see verbose passed as a parameter to fit(), but not as a parameter to ImageClassifier.__init__()
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [ERROR] ParamValidationError: Parameter validation failed: Invalid type for parameter gdbengo 3 10,981 Dec-26-2022, 08:48 AM
Last Post: ibreeden

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020