votes up 1

Attempting to capture an EagerTensor without building a function.

Package:
Exception Class:
RuntimeError

Raise code

red_dtype = preferred_dtype or dtype_hint
  if isinstance(value, EagerTensor):
    if ctx is None:
      ctx = context.context()
    if not ctx.executing_eagerly():
      graph = get_default_graph()
      if not graph.building_function:
        raise RuntimeError("Attempting to capture an EagerTensor without "
                           "building a function.")
      return graph.capture(value, name=name)

  if dtype is not None:
    dtype = dtypes.as_dtype(dtype)
  if isinstance(value, Tensor):
    if dtype is not None and not dtype.is_compatible_with(value.dtype):
      ra

NO FIXES YET

Just press the button and we will add solution
to this exception as soon as possible

* As many users press the button, the faster we create a fix

Add a possible fix

Please authorize to post fix