Questions tagged [eager-execution]

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.

146 questions
1
vote
1 answer

Eager Execution: Could not find valid device for node. {{node Conv2D}}

I'm trying to build a image classifier in Tensorflow under the eager-execution mode. I am receiving the following error. InternalError: Could not find valid device for node. Node: {{node Conv2D}} = Conv2D[T=DT_UINT8, data_format="NHWC",…
1
vote
1 answer

Param for tf.contrib.summary.graph

I am using tensorflow 1.12 and the eager execution mode. I want to summarize the graph to the tensorboard log. I found a function called tf.contrib.summary.graph, however, it requires a parameter called param. What should I pass for this parameter?…
tczj
  • 438
  • 4
  • 17
1
vote
1 answer

Tensorflow.py Protected division

I'm trying to implement a sort of protected division using Tensorflow.where but somehow it seems to be skipping the condition set on the where statement. The main idea is, when dividing x/y , if y == 0. then the result of the division of be x…
eXistanCe
  • 735
  • 1
  • 9
  • 25
1
vote
0 answers

dynamic_decode reports error under eager_execution ? “ValueError: The inequality of unknown TensorShapes is undefined."

I have encountered a weird problem when transforming a usual seq2seq code into eager execution mode. What I changed is very simple that after call enable_eager_execution(), I changed the following input def get_inputs(): inputs =…
Jack2019
  • 275
  • 2
  • 10
1
vote
1 answer

module 'tensorflow._api.v1.metrics' has no attribute 'Mean'

I use tensorflow version 1.12 this is my code train_loss_results = [] train_accuracy_results = [] num_epochs = 201 for epoch in range(num_epochs): epoch_loss_avg = tf.metrics.Mean() epoch_accuracy = tf.metrics.Accuracy() for x,y in…
muyassar
  • 41
  • 1
  • 5
1
vote
1 answer

Difficulty with running gradient descent in eager execution

I've built a neural network with python in TensorFlow, but I can't seem to resolve this issue with TensorFlow's eager execution. All the gradients output zero, and I'm not really sure where I've gone wrong in the program. Originally I was using…
Espresso
  • 187
  • 5
1
vote
1 answer

how to update an 'eagertensor" object in tensorflow

How to update the variables from a keras sequential model (model.variables) if they are eagertensors? When I try to assign to them I get an error that says the object has no attribute "assign".
user3496060
  • 800
  • 10
  • 20
1
vote
1 answer

Tensorflow Access CsvDataset values

Eager execution I have been digging through the API for 2 days and I cant seem to find a way to use the data from a CsvDataset object. I have the following sample from a…
eXistanCe
  • 735
  • 1
  • 9
  • 25
0
votes
0 answers

How/Where decision is made to choose between eager execution & graph execution for Tensorflow kernel OPs

Description : I ran HuggingFace BERT model which uses tensorflow 2.13v with oneDNN support on intel machine and recorded its execution logs by setting TF_CPP_MAX_VLOG_LEVEL=2 & ONEDNN_VERBOSE=1 in file. Observation : I have observing logs that are…
0
votes
0 answers

Problem with the gradients for a tensor flow training

I am training a linear tensorflow model with a custom additional loss which depends on some inner derivatives. The NN recieves an input (x,y) and gives the output (u, v) with some hidden layers in between. I use implicit differentiation to add the…
0
votes
0 answers

Tensorflow cvae error when not using tf.compat.v1.disable_v2_behavior

I am running a toy Variational autoencoder (VAE) as described here https://blog.keras.io/building-autoencoders-in-keras.html, just using mse reconstruction loss. act1 = 'selu' n1 = tf.keras.Input(shape = (input_1+ input_2,) ) n2 = …
ewr3243
  • 397
  • 3
  • 19
0
votes
0 answers

Tensorflow and deriv (R) generate different derivatives for identical optimization problem

I am testing different ways of computing partial derivatives for a simple mathematical graph, and obtain a derivative > 0 when using Tensorflow 2.0 in eager execution mode, while other AD functions return a derivative of 0. First Tensorflow 2.0 in…
Jan C
  • 1
  • 1
0
votes
0 answers

eager execution mode in tensorflow problem

I'm new to TensorFlow. I'm trying to run the following github repo for my classifier. https://github.com/hfawaz/ijcnn19attacks/blob/master/src/cleverhans_tutorials/tsc_tutorial_keras_tf.py I understand running this old code needs to disable…
0
votes
0 answers

Tensorflow functions are not converted to graph mode

I was trying to implement a conjugate gradient for sparse tensors under TensorFlow. The test is the following snippet: EAGERMODE = False import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' import tensorflow as…
Cesare
  • 1
  • 4
0
votes
1 answer

tf.py_function is only for Eager Mode?

Is tf.py_function only for Eager mode, and not for Graph mode? According to tf.py_function says, it gives the impression that tf.py_function is to be used at Eager mode. Wraps a python function into a TensorFlow op that executes it eagerly. This…
mon
  • 18,789
  • 22
  • 112
  • 205