Open kfmn opened 7 years ago
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?
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
run_demo()
File "imdb_lm_gcnn.py", line 65, in run_demo
train_model()
File "imdb_lm_gcnn.py", line 43, in train_model
loss='sparse_categorical_crossentropy')
File "/usr/local/lib/python3.4/dist-packages/keras/engine/training.py", line 619, in compile
sample_weight, mask)
File "/usr/local/lib/python3.4/dist-packages/keras/engine/training.py", line 307, in weighted
score_array = fn(y_true, y_pred)
File "/usr/local/lib/python3.4/dist-packages/keras/objectives.py", line 45, in sparse_categorical_crossentropy
return K.sparse_categorical_crossentropy(y_pred, y_true)
File "/usr/local/lib/python3.4/dist-packages/keras/backend/tensorflow_backend.py", line 1993, in sparse_categorical_crossentropy
return tf.reshape(res, [-1, int(output_shape[-2])])
TypeError: int returned non-int (type NoneType)
regularizers
property of layers/models is deprecated. Regularization losses are now managed via thelosses
layer/model property. warnings.warn('Theregularizers
property of ' Traceback (most recent call last): File "imdb_lm_gcnn.py", line 69, inDo you have any ideas to fix it?