python imdb_embedding_w2v.py
Using TensorFlow backend.
Loading Data...
Tokenising...
Training a Word2vec model...
Transform the Data...
Setting up Arrays for Keras Embedding Layer...
Creating Datesets...
Pad sequences (samples x time)
('X_train shape:', (25000, 100))
('X_test shape:', (25000, 100))
Convert labels to Numpy Sets...
Defining a Simple Sequential Keras Model...
Traceback (most recent call last):
File "imdb_embedding_w2v.py", line 205, in
model.add(Dropout(0.3))
File "/home/shakti/.virtualenvs/keras/local/lib/python2.7/site-packages/keras/models.py", line 308, in add
output_tensor = layer(self.outputs[0])
File "/home/shakti/.virtualenvs/keras/local/lib/python2.7/site-packages/keras/engine/topology.py", line 514, in call
self.add_inbound_node(inbound_layers, node_indices, tensor_indices)
File "/home/shakti/.virtualenvs/keras/local/lib/python2.7/site-packages/keras/engine/topology.py", line 572, in add_inbound_node
Node.create_node(self, inbound_layers, node_indices, tensor_indices)
File "/home/shakti/.virtualenvs/keras/local/lib/python2.7/site-packages/keras/engine/topology.py", line 149, in create_node
output_tensors = to_list(outbound_layer.call(input_tensors[0], mask=input_masks[0]))
File "/home/shakti/.virtualenvs/keras/local/lib/python2.7/site-packages/keras/layers/core.py", line 90, in call
x = K.in_train_phase(K.dropout(x, self.p, noise_shape), x)
File "/home/shakti/.virtualenvs/keras/local/lib/python2.7/site-packages/keras/backend/tensorflow_backend.py", line 1304, in in_train_phase
x = tf.python.control_flow_ops.cond(tf.cast(_LEARNING_PHASE, 'bool'),
AttributeError: 'module' object has no attribute 'control_flow_ops'
Using following version of Keras
pip show keras
Metadata-Version: 2.0
Name: Keras
Version: 1.1.0