AttributeError: 'set' object has no attribute 'set_model' While executing Image Segmentation problem
naiborhujosua opened this issue · 2 comments
naiborhujosua commented
model.compile(optimizer="rmsprop",loss="sparse_categorical_crossentropy")
callbacks ={
keras.callbacks.ModelCheckpoint("oxford_segmentation.keras",save_best_only=True)
}
history = model.fit(train_input_imgs, train_targets,
epochs=50,
callbacks=callbacks,
batch_size=64,
validation_data=(val_input_imgs, val_targets))
epochs =range(1,len(history.history["loss"]) +1)
loss =history.history["loss"]
val_loss =history.history["val_loss"]
plt.figure()
plt.plot(epochs,loss,"bo",label="Training loss")
plt.plot(epochs,val_loss,"b",label="Validation loss")
plt.title("Training and validation loss")
plt.legend()
Got this error while executing image segmentation task
2022-06-01 05:34:53.240805: W tensorflow/python/util/util.cc:348] Sets are not currently considered sequences, but this may change in the future, so consider avoiding using them.
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
/tmp/ipykernel_2964/4216306981.py in <module>
9 callbacks=[callbacks],
10 batch_size=64,
---> 11 validation_data=(val_input_imgs, val_targets))
12
13 epochs =range(1,len(history.history["loss"]) +1)
/opt/conda/lib/python3.7/site-packages/keras/engine/training.py in fit(self, x, y, batch_size, epochs, verbose, callbacks, validation_split, validation_data, shuffle, class_weight, sample_weight, initial_epoch, steps_per_epoch, validation_steps, validation_batch_size, validation_freq, max_queue_size, workers, use_multiprocessing)
1157 verbose=verbose,
1158 epochs=epochs,
-> 1159 steps=data_handler.inferred_steps)
1160
1161 self.stop_training = False
/opt/conda/lib/python3.7/site-packages/keras/callbacks.py in __init__(self, callbacks, add_history, add_progbar, model, **params)
208
209 if model:
--> 210 self.set_model(model)
211 if params:
212 self.set_params(params)
/opt/conda/lib/python3.7/site-packages/keras/callbacks.py in set_model(self, model)
283 model.history = self._history
284 for callback in self.callbacks:
--> 285 callback.set_model(model)
286
287 def _call_batch_hook(self, mode, hook, batch, logs=None):
AttributeError: 'set' object has no attribute 'set_model'
ROCASSO commented
the same issue as yours, any ideas now?
ifond commented
YES!!! I have received your E-mail——Steven Lee