cderinbogaz / inpredo

Inpredo is a Deep Learning tool which looks into financial charts and predicts stock movements.
https://towardsdatascience.com/making-a-i-that-looks-into-trade-charts-62e7d51edcba
MIT License
159 stars 93 forks source link

Key error ''accuracy" #18

Open hxapartners opened 3 years ago

hxapartners commented 3 years ago

KeyError: 'accuracy'

Here is the code model.compile(loss='categorical_crossentropy', optimizer=optimizers.RMSprop(), metrics=['accuracy']) """""rest of code not shown here. """"""""""""""" """ Tensorboard log """ target_dir = "../models/weights-improvement-{epoch:02d}-{accuracy:.2f}.hdf5" if not os.path.exists(target_dir): os.mkdir(target_dir) model.save('../models/model.h5') model.save_weights('../models/weights.h5')

checkpoint = ModelCheckpoint(target_dir, monitor='accuracy', verbose=1, save_best_only=True, mode='max')

callbacks_list = [checkpoint]

model.fit_generator( train_generator, steps_per_epoch=nb_train_samples//batch_size, epochs=epochs, shuffle=True, validation_data=validation_generator, callbacks=callbacks_list, validation_steps=nb_validation_samples//batch_size)

There is an error with the checkpoint as it does not recognize the key 'accuracy'. It is the same key used in compile of the model above as well.

What could be the issue her ?

cderinbogaz commented 3 years ago

hi @hxapartners which version of tensorflow is installed on your system?