Skip to content
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

Check failed: NDIMS == dims() (2 vs. 1) #9282

Closed
LucasMahieu opened this issue Apr 18, 2017 · 2 comments
Closed

Check failed: NDIMS == dims() (2 vs. 1) #9282

LucasMahieu opened this issue Apr 18, 2017 · 2 comments

Comments

@LucasMahieu
Copy link

LucasMahieu commented Apr 18, 2017

I get the following error after building the graph of my NN. when I try to execute :

loss, _ = self._sess.run([self.loss_op, self.train_op], feed_dict=feed_dict)

I get this error :

F tensorflow/core/framework/tensor_shape.cc:36] Check failed: NDIMS == dims() (2 vs. 1) Asking for tensor of 2 dimensions from a tensor of 1 dimensions

I don't succeed to know to which part of the graph this error is related to ... Because, normaly the graph is build, so shapes should be correct ... are not ?

I am using Tensorflow version 1.0.0 with python API.

It could be a bug according to the first reply here : http://stackoverflow.com/questions/43413293/tensorflow-check-failed-ndims-dims-2-vs-1

@drpngx drpngx added type:bug Bug stat:awaiting response Status - Awaiting response from author stat:contribution welcome Status - Contributions welcome and removed stat:awaiting response Status - Awaiting response from author stat:contribution welcome Status - Contributions welcome labels Apr 18, 2017
@drpngx
Copy link
Contributor

drpngx commented Apr 18, 2017

That seems like a bug. Could you share the simple possible repro you can find?

@LucasMahieu
Copy link
Author

I succeed to find the source of the error.
It was caused by the bad shape of an input tensor of a custom op.
I have create a custom op, coded in C++, used in Python.
I think an improvement could be done in the error message. Indeed, with this line only, it is difficult to find the source of this error.

@aselle aselle removed the stat:awaiting response Status - Awaiting response from author label Apr 19, 2017
@drpngx drpngx added type:bug Bug and removed type:bug Bug labels Apr 19, 2017
@drpngx drpngx closed this as completed Apr 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants