---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
<ipython-input-5-aca322c5f1e7> in <module>()
1 network = models.Sequential()
----> 2 network.add(layers.Dense(512,activation='relu',input_shape=(28*28,)))
3 network.add(layers.Dense(10,activation='softmax'))
~/DL/lib/python3.5/site-packages/keras/models.py in add(self, layer)
461 x = Input(batch_shape=batch_shape,
462 dtype=dtype,
--> 463 name=layer.name + '_input')
464 # This will build the current layer
465 # and create the node connecting the current layer
~/DL/lib/python3.5/site-packages/keras/engine/topology.py in Input(shape, batch_shape, name, dtype, sparse, tensor)
1453 name=name, dtype=dtype,
1454 sparse=sparse,
-> 1455 input_tensor=tensor)
1456 # Return tensor including _keras_shape and _keras_history.
1457 # Note that in this case train_output and test_output are the same pointer.
~/DL/lib/python3.5/site-packages/keras/legacy/interfaces.py in wrapper(*args, **kwargs)
89 warnings.warn('Update your `' + object_name +
90 '` call to the Keras 2 API: ' + signature, stacklevel=2)
---> 91 return func(*args, **kwargs)
92 wrapper._original_function = func
93 return wrapper
~/DL/lib/python3.5/site-packages/keras/engine/topology.py in __init__(self, input_shape, batch_size, batch_input_shape, dtype, input_tensor, sparse, name)
1362 dtype=dtype,
1363 sparse=self.sparse,
-> 1364 name=self.name)
1365 else:
1366 self.is_placeholder = False
~/DL/lib/python3.5/site-packages/keras/backend/tensorflow_backend.py in placeholder(shape, ndim, dtype, sparse, name)
502 x = tf.sparse_placeholder(dtype, shape=shape, name=name)
503 else:
--> 504 x = tf.placeholder(dtype, shape=shape, name=name)
505 x._keras_shape = shape
506 x._uses_learning_phase = False
~/DL/lib/python3.5/site-packages/tensorflow/python/ops/array_ops.py in placeholder(dtype, shape, name)
1675 """
1676 if context.in_eager_mode():
-> 1677 raise RuntimeError("tf.placeholder() is not compatible with "
1678 "eager execution.")
1679
RuntimeError: tf.placeholder() is not compatible with eager execution.