Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'LossPlot' object has no attribute 'totals' #3

Open
fgolemo opened this issue Aug 5, 2016 · 1 comment
Open

AttributeError: 'LossPlot' object has no attribute 'totals' #3

fgolemo opened this issue Aug 5, 2016 · 1 comment

Comments

@fgolemo
Copy link

fgolemo commented Aug 5, 2016

When running the IPython notebook example, I get the following error:

AttributeError                            Traceback (most recent call last)
<ipython-input-6-9386fd8b8064> in <module>()
      1 model.fit(X_train, Y_train, batch_size=batch_size, nb_epoch=nb_epoch,
      2           show_accuracy=True, verbose=1, validation_data=(X_test, Y_test),
----> 3           callbacks=[loss_plot, conv_weights])

/usr/local/lib/python2.7/dist-packages/keras/models.pyc in fit(self, x, y, batch_size, nb_epoch, verbose, callbacks, validation_split, validation_data, shuffle, class_weight, sample_weight, **kwargs)
    406                               shuffle=shuffle,
    407                               class_weight=class_weight,
--> 408                               sample_weight=sample_weight)
    409 
    410     def evaluate(self, x, y, batch_size=32, verbose=1,

/usr/local/lib/python2.7/dist-packages/keras/engine/training.pyc in fit(self, x, y, batch_size, nb_epoch, verbose, callbacks, validation_split, validation_data, shuffle, class_weight, sample_weight)
   1051                               verbose=verbose, callbacks=callbacks,
   1052                               val_f=val_f, val_ins=val_ins, shuffle=shuffle,
-> 1053                               callback_metrics=callback_metrics)
   1054 
   1055     def evaluate(self, x, y, batch_size=32, verbose=1, sample_weight=None):

/usr/local/lib/python2.7/dist-packages/keras/engine/training.pyc in _fit_loop(self, f, ins, out_labels, batch_size, nb_epoch, verbose, callbacks, val_f, val_ins, shuffle, callback_metrics)
    810                         for l, o in zip(out_labels, val_outs):
    811                             epoch_logs['val_' + l] = o
--> 812             callbacks.on_epoch_end(epoch, epoch_logs)
    813             if callback_model.stop_training:
    814                 break

/usr/local/lib/python2.7/dist-packages/keras/callbacks.pyc in on_epoch_end(self, epoch, logs)
     37     def on_epoch_end(self, epoch, logs={}):
     38         for callback in self.callbacks:
---> 39             callback.on_epoch_end(epoch, logs)
     40 
     41     def on_batch_begin(self, batch, logs={}):

/usr/local/lib/python2.7/dist-packages/agnez-0.1.0-py2.7.egg/agnez/app_callbacks.pyc in on_epoch_end(self, epoch, logs)
     75 
     76     def on_epoch_end(self, epoch, logs={}):
---> 77         self.train_values.append(self.totals['loss']/self.seen)
     78         self.valid_values.append(logs['val_loss'])
     79 

AttributeError: 'LossPlot' object has no attribute 'totals'

...and I don't entirely know how to fix this. Any help appreciated.

I checked and there is a self.totals in agnez/keras_callbacks.py (in the Plot class), which doesn't seem to be used here, and in keras/callbacks.py (BaseLogger class, but also not sure if used here).

My Keras is version 1.0.6, Theano version 0.9.0dev1.dev-a668c6c5b6d055b233aa5bc50b22800d996ffce1 on Python 2.7, Ubuntu 15.10 64bit.

@EderSantana
Copy link
Member

sorry, maybe there is a compatibility Issue.
the last time I tried this was back in keras 0.3

if you find the bug please make a PR and I'll be glad to review
thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants