nn_playground
nn_playground copied to clipboard
Error in running imdb_lm_gcnn.py
Hi,
I'm trying to run imdb_lm_gcnn.py to test your demo. I use keras 1.2.0 with tensorflow 0.10.0 on ubuntu 14.04 But I got the following error log:
/usr/local/lib/python3.4/dist-packages/keras/engine/topology.py:368: UserWarning: The regularizers
property of layers/models is deprecated. Regularization losses are now managed via the losses
layer/model property.
warnings.warn('The regularizers
property of '
Traceback (most recent call last):
File "imdb_lm_gcnn.py", line 69, in
Do you have any ideas to fix it?
update keras to head should fix it, see this pr.
Thank you for your answer. I used "sudo pip install --upgrade keras" to update but this had no effect on tensorflow_backend.py Then I manually replaced this line as shown at this pr. When I run python 2.7 it still raises error on the same line but with other synopsis:
File "/usr/local/lib/python2.7/dist-packages/keras/backend/tensorflow_backend.py", line 1994, in sparse_categorical_crossentropy
return tf.reshape(res, tf.shape(output)[:-1])
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/array_ops.py", line 315, in _SliceHelper
"Negative stop indices are not currently supported")
When I run python 3.4 this line is passed successfully and table with model topology is shown, but other exceptions are raised:
Epoch 1/100
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python3.4/threading.py", line 920, in _bootstrap_inner
self.run()
File "/usr/lib/python3.4/threading.py", line 868, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.4/dist-packages/keras/engine/training.py", line 409, in data_generator_task
generator_output = next(generator)
File "/home/superuser/nn_playground/gcnn/imdb_generator.py", line 72, in __call__
data = cPickle.load(fp)
File "/usr/lib/python3.4/codecs.py", line 319, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc9 in position 30: invalid continuation byte
Traceback (most recent call last):
File "imdb_lm_gcnn.py", line 69, in <module>
run_demo()
File "imdb_lm_gcnn.py", line 65, in run_demo
train_model()
File "imdb_lm_gcnn.py", line 61, in train_model
nb_epoch=nb_epoch, verbose=1)
File "/usr/local/lib/python3.4/dist-packages/keras/engine/training.py", line 1481, in fit_generator
str(generator_output))
ValueError: output of generator should be a tuple (x, y, sample_weight) or (x, y). Found: None
What do I do wrong ?
Probably, my pickle file imdp-full.pkl was not build correctly... Could you provide your file for me to compare and proceed?