keras-team / autokeras

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

Error : Not implemented #1616

Open cchantra opened 3 years ago

cchantra commented 3 years ago

Bug Description

INFO:tensorflow:Reloading Oracle from existing project ./image_classifier/oracle.json

Search: Running Trial #1

Hyperparameter |Value |Best Value So Far image_block_1/b...|vanilla |?
image_block_1/n...|True |?
image_block_1/a...|False |?
image_block_1/c...|3 |?
image_block_1/c...|1 |?
image_block_1/c...|2 |?
image_block_1/c...|True |?
image_block_1/c...|False |?
image_block_1/c...|0.25 |?
image_block_1/c...|32 |?
image_block1/c...|64 |?
classification
...|flatten |?
classification_...|0.5 |?
optimizer |adam |?
learning_rate |0.001 |?


NotImplementedError Traceback (most recent call last) /tmp/ipykernel_50881/2280568104.py in 1 clf = ak.ImageClassifier( max_trials=4) ----> 2 clf.fit(img_train_array, train_labels, epochs=100) 3 4 5 # Predict with the best model.

~/anaconda3/envs/tf2.5/lib/python3.9/site-packages/autokeras/tasks/image.py in fit(self, x, y, epochs, callbacks, validation_split, validation_data, **kwargs) 157 keras.Model.fit. 158 """ --> 159 super().fit( 160 x=x, 161 y=y,

~/anaconda3/envs/tf2.5/lib/python3.9/site-packages/autokeras/auto_model.py in fit(self, x, y, batch_size, epochs, callbacks, validation_split, validation_data, verbose, **kwargs) 276 ) 277 --> 278 self.tuner.search( 279 x=dataset, 280 epochs=epochs,

~/anaconda3/envs/tf2.5/lib/python3.9/site-packages/autokeras/engine/tuner.py in search(self, epochs, callbacks, validation_split, verbose, fit_kwargs) 186 self.oracle.update_space(hp) 187 --> 188 super().search( 189 epochs=epochs, callbacks=new_callbacks, verbose=verbose, fit_kwargs 190 )

~/anaconda3/envs/tf2.5/lib/python3.9/site-packages/keras_tuner/engine/base_tuner.py in search(self, *fit_args, *fit_kwargs) 142 143 self.on_trial_begin(trial) --> 144 self.run_trial(trial, fit_args, **fit_kwargs) 145 self.on_trial_end(trial) 146 self.on_search_end()

~/anaconda3/envs/tf2.5/lib/python3.9/site-packages/keras_tuner/engine/tuner.py in run_trial(self, trial, *fit_args, **fit_kwargs) 179 copied_fit_kwargs["callbacks"] = callbacks 180 --> 181 self._build_and_fit_model(trial, fit_args, copied_fit_kwargs) 182 183 def save_model(self, trial_id, model, step=0):

~/anaconda3/envs/tf2.5/lib/python3.9/site-packages/autokeras/engine/tuner.py in _build_and_fit_model(self, trial, fit_args, fit_kwargs) 97 98 model = self.hypermodel.build(trial.hyperparameters) ---> 99 self.adapt(model, fitkwargs["x"]) 100 101 , history = utils.fit_with_adaptive_batch_size(

~/anaconda3/envs/tf2.5/lib/python3.9/site-packages/autokeras/engine/tuner.py in adapt(model, dataset) 130 while layer is not None: 131 if isinstance(layer, preprocessing.PreprocessingLayer): --> 132 layer.adapt(temp_x) 133 temp_x = temp_x.map(layer) 134 layer = get_output_layer(layer.output)

~/anaconda3/envs/tf2.5/lib/python3.9/site-packages/keras/engine/base_preprocessing_layer.py in adapt(self, data, batch_size, steps) 234 self.compile() # Compile with defaults. 235 if self.built: --> 236 self.reset_state() 237 data_handler = data_adapter.DataHandler( 238 data,

~/anaconda3/envs/tf2.5/lib/python3.9/site-packages/keras/engine/base_preprocessing_layer.py in _reset_state_wrapper(self) 254 def _reset_state_wrapper(self): 255 """Calls reset_state and sets adapted to False.""" --> 256 self._reset_state_impl() 257 self._is_adapted = False 258

~/anaconda3/envs/tf2.5/lib/python3.9/site-packages/keras/engine/base_preprocessing_layer.py in reset_state(self) 82 def reset_state(self): # pylint: disable=method-hidden 83 """Resets the statistics of the preprocessing layer.""" ---> 84 raise NotImplementedError 85 86 @doc_controls.do_not_generate_docs

NotImplementedError:

Bug Reproduction

Data used by the code: Image RGB Facial dataset

Expected Behavior

Setup Details

Include the details about the versions of:

The error occurs when calling fit(..). The same code does not produce errors in google colab.

Samar-080301 commented 3 years ago

can you please give the URL of the dataset?