8000 TF code crashes python kernel · Issue #449 · tensorflow/tensorflow · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

TF code crashes python kernel #449

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
alquraishi opened this issue Dec 8, 2015 · 6 comments
Closed

TF code crashes python kernel #449

alquraishi opened this issue Dec 8, 2015 · 6 comments
Assignees
Labels

Comments

@alquraishi
Copy link

The following piece of code:

import tensorflow as tf
a = tf.placeholder(tf.float32, shape=(-1, 10))
sess = tf.Session()
sess.run(tf.array_ops.shape(a))

crashes the Python kernel. I realize it's not right (for one thing I'm not feeding it a feed_dict), but it should give an error and not crash the kernel.

@girving girving added the bug label Dec 8, 2015
@girving
Copy link
Contributor
girving commented Dec 8, 2015

Nice catch! Yes, that is a bad bug.

@girving girving self-assigned this Dec 8, 2015
@girving
Copy link
Contributor
girving commented Dec 8, 2015

I have this fixed at the kernel level, so it won't crash anymore. However, I could also fix it at the shape inference level so it throws a Python exception at graph construction time. To do this, I'd need to make tf.Dimension insist on nonnegative input.

@vrv: Do you think that's wise? I'd be a bit worried that negative dimensions are used somewhere, but it's currently a bit inconsistent that C++ TensorShape requires nonnegative but Python TensorShape does not.

@girving
Copy link
Contributor
girving commented Dec 8, 2015

C++ part in review.

@vrv vrv closed this as completed in 5de9085 Dec 9, 2015
@vrv
Copy link
vrv commented Dec 9, 2015

I'm not sure yet if its wise -- the C++ TensorShape class thinks about shapes more concretely: it doesn't support unspecified dimensions / -1 / shape inference, etc.

I think when we push shape inference down into the C++ code, we'll likely have a C++ class that more closely represents what the python TensorShape class does.

@girving
Copy link
Contributor
girving commented Dec 9, 2015

Cool, I'm happy to leave it the way it is now that the C++ is fixed.

@aselle aselle added type:bug Bug and removed bug labels Feb 9, 2017
teamdandelion pushed a commit to tensorflow/tensorboard that referenced this issue May 23, 2017
Change 109738410
	Don't crash if an attribute contains an invalid shape

	Using GetAttr to retrieve a TensorShape caused a process crash if the shape
	contained negative entries or was too large.  Instead, produce useful error
	messages (and Python exceptions).

	Fixes tensorflow/tensorflow#449.
Change 109737915
	TensorFlow: fix build failures and some warnings when built with clang
	on OS X.
Change 109737559
	Fix bad paragraphing
Change 109735757
	Fix OSX installation instructions.
Change 109733797
	Adds buttons to toggle the display of all runs.

Base CL: 109739474
tarasglek pushed a commit to tarasglek/tensorflow that referenced this issue Jun 20, 2017
Fix signature change of resize_images()
@bdevyansh
Copy link

try using numpy befor importing tensorflow or keras

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants
0