deep-learning-with-python-notebooks icon indicating copy to clipboard operation
deep-learning-with-python-notebooks copied to clipboard

Symbolic Error (Eager execution) in 8.4

Open RS0099 opened this issue 5 years ago • 0 comments

TypeError Traceback (most recent call last) /usr/local/lib/python3.6/dist-packages/tensorflow/python/eager/execute.py in quick_execute(op_name, num_outputs, inputs, attrs, ctx, name) 59 tensors = pywrap_tfe.TFE_Py_Execute(ctx._handle, device_name, op_name, ---> 60 inputs, attrs, num_outputs) 61 except core._NotOkStatusException as e:

TypeError: An op outside of the function building code is being passed a "Graph" tensor. It is possible to have Graph tensors leak out of the function building context by including a tf.init_scope in your function building code. For example, the following function will fail: @tf.function def has_init_scope(): my_constant = tf.constant(1.) with tf.init_scope(): added = my_constant * 2 The graph tensor has name: dense_2/BiasAdd:0

During handling of the above exception, another exception occurred:

_SymbolicException Traceback (most recent call last) 9 frames /usr/local/lib/python3.6/dist-packages/tensorflow/python/eager/execute.py in quick_execute(op_name, num_outputs, inputs, attrs, ctx, name) 72 raise core._SymbolicException( 73 "Inputs to eager execution function cannot be Keras symbolic " ---> 74 "tensors, but found {}".format(keras_symbolic_tensors)) 75 raise e 76 # pylint: enable=protected-access

_SymbolicException: Inputs to eager execution function cannot be Keras symbolic tensors, but found [<tf.Tensor 'dense_2/BiasAdd:0' shape=(None, 2) dtype=float32>, <tf.Tensor 'dense_1/BiasAdd:0' shape=(None, 2) dtype=float32>]

pls help . the tensorflow version is 2.3

RS0099 avatar Oct 17 '20 15:10 RS0099