davidtellez / contrastive-predictive-coding

Keras implementation of Representation Learning with Contrastive Predictive Coding
525 stars 120 forks source link

AttributeError: 'SortedNumberGenerator' object has no attribute 'shape' #10

Closed osotsia closed 4 years ago

osotsia commented 4 years ago

When I try to run train_model.py, I'm getting this error in Tensorflow 1.14, and keras 2.3.1. Any suggestions?

Thanks.

Traceback (most recent call last): File "train_model.py", line 164, in <module> color=True File "train_model.py", line 144, in train_model callbacks=callbacks File "/home/song/anaconda2/envs/CPCenv/lib/python3.6/site-packages/tensorflow/python/keras/engine/training.py", line 1433, in fit_generator steps_name='steps_per_epoch') File "/home/song/anaconda2/envs/CPCenv/lib/python3.6/site-packages/tensorflow/python/keras/engine/training_generator.py", line 144, in model_iteration shuffle=shuffle) File "/home/song/anaconda2/envs/CPCenv/lib/python3.6/site-packages/tensorflow/python/keras/engine/training_generator.py", line 480, in convert_to_generator_like num_samples = int(nest.flatten(data)[0].shape[0]) AttributeError: 'SortedNumberGenerator' object has no attribute 'shape'

Edit: problem was the keras installation