disable Tensorflow eager execution
I am trying to learn TF and working with placeholders. When I tried to create the placeholder, I got an error: RuntimeError: tf.placeholder() is not compatible with eager execution
which makes sense as placeholders are not executable immediately.
My struggle is in finding how to turn eager execution off?
I have never turned eager execution on in the first place so not sure how it happened. Is there an opposite to tf.disable_eager_execution()
?
Thank you!
tensorflow
add a comment |
I am trying to learn TF and working with placeholders. When I tried to create the placeholder, I got an error: RuntimeError: tf.placeholder() is not compatible with eager execution
which makes sense as placeholders are not executable immediately.
My struggle is in finding how to turn eager execution off?
I have never turned eager execution on in the first place so not sure how it happened. Is there an opposite to tf.disable_eager_execution()
?
Thank you!
tensorflow
That doesn't seem right, eager execution should not be enabled by default (although it seems that will change in TensorFlow 2.x). I don't think there is anything to disable eager execution, since it is supposed to either be enabled at the beginning of your program or not used at all. There must be something in your program enabling it, maybe some imported module. You can usetf.executing_eagerly()
(e.g. after eachimport
) to try to find at what point it gets enabled.
– jdehesa
Nov 22 '18 at 12:00
add a comment |
I am trying to learn TF and working with placeholders. When I tried to create the placeholder, I got an error: RuntimeError: tf.placeholder() is not compatible with eager execution
which makes sense as placeholders are not executable immediately.
My struggle is in finding how to turn eager execution off?
I have never turned eager execution on in the first place so not sure how it happened. Is there an opposite to tf.disable_eager_execution()
?
Thank you!
tensorflow
I am trying to learn TF and working with placeholders. When I tried to create the placeholder, I got an error: RuntimeError: tf.placeholder() is not compatible with eager execution
which makes sense as placeholders are not executable immediately.
My struggle is in finding how to turn eager execution off?
I have never turned eager execution on in the first place so not sure how it happened. Is there an opposite to tf.disable_eager_execution()
?
Thank you!
tensorflow
tensorflow
edited Nov 22 '18 at 15:19


Anubhav Singh
1431212
1431212
asked Nov 22 '18 at 11:24
Lloyd RaynerLloyd Rayner
162
162
That doesn't seem right, eager execution should not be enabled by default (although it seems that will change in TensorFlow 2.x). I don't think there is anything to disable eager execution, since it is supposed to either be enabled at the beginning of your program or not used at all. There must be something in your program enabling it, maybe some imported module. You can usetf.executing_eagerly()
(e.g. after eachimport
) to try to find at what point it gets enabled.
– jdehesa
Nov 22 '18 at 12:00
add a comment |
That doesn't seem right, eager execution should not be enabled by default (although it seems that will change in TensorFlow 2.x). I don't think there is anything to disable eager execution, since it is supposed to either be enabled at the beginning of your program or not used at all. There must be something in your program enabling it, maybe some imported module. You can usetf.executing_eagerly()
(e.g. after eachimport
) to try to find at what point it gets enabled.
– jdehesa
Nov 22 '18 at 12:00
That doesn't seem right, eager execution should not be enabled by default (although it seems that will change in TensorFlow 2.x). I don't think there is anything to disable eager execution, since it is supposed to either be enabled at the beginning of your program or not used at all. There must be something in your program enabling it, maybe some imported module. You can use
tf.executing_eagerly()
(e.g. after each import
) to try to find at what point it gets enabled.– jdehesa
Nov 22 '18 at 12:00
That doesn't seem right, eager execution should not be enabled by default (although it seems that will change in TensorFlow 2.x). I don't think there is anything to disable eager execution, since it is supposed to either be enabled at the beginning of your program or not used at all. There must be something in your program enabling it, maybe some imported module. You can use
tf.executing_eagerly()
(e.g. after each import
) to try to find at what point it gets enabled.– jdehesa
Nov 22 '18 at 12:00
add a comment |
1 Answer
1
active
oldest
votes
Assume you are using Tensorflow 2.0 preview release which has eager execution enabled by default. There is a disable_eager_execution()
in v1 API, which you can put in the front of your code like:
import tensorflow as tf
tf.compat.v1.disable_eager_execution()
On the other hand, if you are not using 2.0 preview, please check if you accidentally enabled eager execution somewhere.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53429896%2fdisable-tensorflow-eager-execution%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Assume you are using Tensorflow 2.0 preview release which has eager execution enabled by default. There is a disable_eager_execution()
in v1 API, which you can put in the front of your code like:
import tensorflow as tf
tf.compat.v1.disable_eager_execution()
On the other hand, if you are not using 2.0 preview, please check if you accidentally enabled eager execution somewhere.
add a comment |
Assume you are using Tensorflow 2.0 preview release which has eager execution enabled by default. There is a disable_eager_execution()
in v1 API, which you can put in the front of your code like:
import tensorflow as tf
tf.compat.v1.disable_eager_execution()
On the other hand, if you are not using 2.0 preview, please check if you accidentally enabled eager execution somewhere.
add a comment |
Assume you are using Tensorflow 2.0 preview release which has eager execution enabled by default. There is a disable_eager_execution()
in v1 API, which you can put in the front of your code like:
import tensorflow as tf
tf.compat.v1.disable_eager_execution()
On the other hand, if you are not using 2.0 preview, please check if you accidentally enabled eager execution somewhere.
Assume you are using Tensorflow 2.0 preview release which has eager execution enabled by default. There is a disable_eager_execution()
in v1 API, which you can put in the front of your code like:
import tensorflow as tf
tf.compat.v1.disable_eager_execution()
On the other hand, if you are not using 2.0 preview, please check if you accidentally enabled eager execution somewhere.
edited Jan 8 at 22:54
kenlukas
1,38931317
1,38931317
answered Jan 8 at 19:08
user2117745user2117745
212
212
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53429896%2fdisable-tensorflow-eager-execution%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
That doesn't seem right, eager execution should not be enabled by default (although it seems that will change in TensorFlow 2.x). I don't think there is anything to disable eager execution, since it is supposed to either be enabled at the beginning of your program or not used at all. There must be something in your program enabling it, maybe some imported module. You can use
tf.executing_eagerly()
(e.g. after eachimport
) to try to find at what point it gets enabled.– jdehesa
Nov 22 '18 at 12:00