TensorFlow's eager execution is an imperative programming environment that evaluates operations immediately, without building graphs: operations return concrete values instead of constructing a computational graph to run later. This makes it easy to get started with TensorFlow and debug models, and it reduces boilerplate as well. To follow along with this guide, run the code samples below in an interactive python interpreter.
Questions tagged [eager-execution]
146 questions
0
votes
1 answer
Tensorflow multinomial distribution with eager execution
I am coming from this tutorial, which uses a multinomial distribution in eager execution to get a final prediction for the next character for text generation, based on a predictions tensor coming from our RNN.
# using a multinomial distribution to…

mrk
- 8,059
- 3
- 56
- 78
0
votes
0 answers
tensorflow program terminates without running to the end
I wrote the following code for image classification following the tutorial in the tensorflow website about dataset creation. The problem is that after creating the dataset variable, the code just stop executing and terminates.
path_ds =…
user5586747
0
votes
1 answer
Matrix Multiplication between eager and non-eager execution in tensorflow
The matrix multiplication values vary when tensorflow is run in eager mode vs graph mode
The code flow is different for eager and non-eager executions within tensorflow. But the values must match ideally, which is not.
Eager execution:
import…

shilpa sangappa
- 5
- 4
0
votes
0 answers
Colab recent update leads to error: Tensor objects are only iterable when eager execution is enabled
I have a google Colab notebook inspired from https://github.com/kyzhouhzau/BERT-NER that worked perfectly fine a couple of months ago.
Now it fails during training at the line
estimator.train(input_fn=train_input_fn, max_steps=num_train_steps)
With…

yoann
- 311
- 5
- 17
0
votes
1 answer
Saving more than one scalar to TensorBoard
I am on Eager Mode, and I am trying to plot the evolution of some scalars in TensorBoard.
I have managed to do it for one - the loss function - by using:
summary_writer = tf.contrib.summary.create_file_writer(log_dir, flush_millis=10000)
…

python_enthusiast
- 896
- 2
- 7
- 26
0
votes
1 answer
Different behaviour with and without @tf.function
The following code will not produce "Fizz" when the value of i is a multiple of 3:
@tf.function
def fizzbuzz(n):
msg = tf.constant('')
for i in tf.range(n):
if int(i % 3) == 0:
msg += 'Fizz'
elif tf.equal(i % 5, 0):
msg +=…

soloice
- 980
- 8
- 17
0
votes
1 answer
Is there a way of knowing if `.repeat`/`.batch`/`.shuffle` have been used on a tensorflow dataset?
One gets an already built tensorflow dataset object (tf.data.Dataset) named data.
Is there a way to know if the function repeat/batch/shuffle was called on this object, by inspecting data ? (and possibly get other informations like the argument of…

jeandut
- 2,471
- 4
- 29
- 56
0
votes
1 answer
Training custom-made CNN model in eager execution programming environment
I have built CNN model by using the principle of "Model Sublclassing" in Keras. Here is the class which represents my model:
class ConvNet(tf.keras.Model):
def __init__(self, data_format, classes):
super(ConvNet, self).__init__()
…

Stefan Radonjic
- 1,449
- 4
- 19
- 38
0
votes
0 answers
Tensorflow v1.4 eager execution
I am aware that Tensorflow v1.5+ comes shipped with Eager execution, however, I can't install any version higher than v1.4 due to its CUDA/CuDNN requirements (https://www.tensorflow.org/install/source#tested_build_configurations). Specifically,…

Roy
- 3,027
- 4
- 29
- 43
-1
votes
1 answer
Dataset's from_generator fails with a "Only integers are valid indices" in eager mode only, no error in graph mode
I am creating a tensorflow Dataset using the from_generator function. In graph/session mode, it works fine:
import tensorflow as tf
x = {str(i): i for i in range(10)}
def gen():
for i in x:
yield x[i]
ds =…

user209974
- 1,737
- 2
- 15
- 31
-1
votes
1 answer
How to convert resnet50 into coreml model?
How to convert resnet50 network written in eager_execution mode into coreml?
Here is the tf resnet50 implementation:
https://github.com/tensorflow/tensorflow/blob/r1.13/tensorflow/contrib/eager/python/examples/resnet50/resnet50.py

Azi
- 11
- 2