avisingh599 / visual-qa

[Reimplementation Antol et al 2015] Keras-based LSTM/CNN models for Visual Question Answering
https://avisingh599.github.io/deeplearning/visual-qa/
MIT License
480 stars 186 forks source link

FYI it doesn't work with the latest version of Keras (v. 0.3) #9

Open ili3p opened 8 years ago

ili3p commented 8 years ago

Error log:

python trainMLP.py
Using Theano backend.
loaded vgg features
loaded word2vec features...
Compiling model...
Compilation done...
Training started...
   128/215375 [..............................]Traceback (most recent call last):
  File "trainMLP.py", line 116, in <module>
    main()
  File "trainMLP.py", line 108, in main
    progbar.add(args.batch_size, values=[("train loss", loss)])
  File "/root/anaconda2/lib/python2.7/site-packages/keras/utils/generic_utils.py", line 143, in add
    self.update(self.seen_so_far+n, values)
  File "/root/anaconda2/lib/python2.7/site-packages/keras/utils/generic_utils.py", line 112, in update
    avg = self.sum_values[k][0] / max(1, self.sum_values[k][1])
TypeError: unsupported operand type(s) for /: 'list' and 'int'
avisingh599 commented 8 years ago

Thanks for reporting this. I have not upgraded yet, but the following change should fix this particular error:

108: progbar.add(args.batch_size, values=[("train loss", loss[0])])