I have a model that I've created in Tensorflow (using Keras).
In pseudo-code, without writing too much of the data-specific ops, it is roughly:
iter_count = tf.keras.layers.Dense(1)(input)
#scale iter_count between 1 and int_max
for i in tf.range(iter_count):
inputvariation = tf.concat([input, i])
box = tf.keras.layers.Dense(4)(inputvariation)
#append to TensorArray
#stack and return TensorArray
However, this outputs an error that the model can't be sorted into topological order. Does this mean I can't run loops in my model?
Some errors:
E tensorflow/core/grappler/optimizers/dependency_optimizer.cc:771] Iteration = 0, topological sort failed with message: The graph couldn't be sorted in topological order.
W tensorflow/core/common_runtime/process_function_library_runtime.cc:941] Ignoring multi-device function optimization failure: INVALID_ARGUMENT: The graph couldn't be sorted in topological order.