Skip to content

Example MNIST erroring on assertion #4210

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
christywarden734 opened this issue Feb 24, 2020 · 5 comments
Closed

Example MNIST erroring on assertion #4210

christywarden734 opened this issue Feb 24, 2020 · 5 comments
Assignees

Comments

@christywarden734
Copy link

Hello!

I am trying to run the MNIST example and am running into an error here: https://github.com/pytorch/glow/blob/master/examples/mnist.cpp#L170

With the error being

Assertion failed: (indices.size() <= strides.size() && "Invalid number of indices"), function getFlattenedOffset, file /Users/christywarden/differentiable/thirdparty/glow/include/glow/Base/Tensor.h, line 967.
Abort trap: 6

I added a statement right before the assertion:
if (indices.size() > strides.size()) { LOG(INFO) << "Indices size: #" << indices.size(); LOG(INFO) << "Strides size: #" << indices.size(); }

which printed

I0224 11:32:14.609498 138560960 Tensor.h:968] Indices size: #2
I0224 11:32:14.609501 138560960 Tensor.h:969] Strides size: #2

before erroring.

Any help understanding what could be going on would be greatly appreciated :) Thanks so much!

@maxwillzq
Copy link
Contributor

change this line

auto correct = label.getHandle<sdim_t>().at({0, 0});

to

auto correct = label.getHandle<sdim_t>().at({0});

because label is 1D tensor

@jfix71
Copy link
Contributor

jfix71 commented Mar 9, 2020

@christywarden734 Yes, as @maxwillzq noted this should be changed. Would either of you like to put up this easy fix?

@maxwillzq
Copy link
Contributor

@jfix71 can you assigned to me? I can fix it?

@maxwillzq
Copy link
Contributor

add PR #4598 to fix this small bug

@maxwillzq
Copy link
Contributor

My fix #4598 already solve this problem. It passes the test. However, I have no authority to merge code. see #4598

facebook-github-bot pushed a commit that referenced this issue Jun 25, 2020
Summary:
Documentation:

[Optional Fixes #issue]
Pull Request resolved: #4598

Test Plan: Please see a detailed explanation of how to fill out the fields in the relevant sections in PULL_REQUEST.md.

Reviewed By: gcatron

Differential Revision: D22049183

Pulled By: jfix71

fbshipit-source-id: fc8261bf4d7dc41c8c4f52d12815396978f7bc75
vdantu pushed a commit to vdantu/glow that referenced this issue Jul 12, 2020
Summary:
Documentation:

[Optional Fixes #issue]
Pull Request resolved: pytorch#4598

Test Plan: Please see a detailed explanation of how to fill out the fields in the relevant sections in PULL_REQUEST.md.

Reviewed By: gcatron

Differential Revision: D22049183

Pulled By: jfix71

fbshipit-source-id: fc8261bf4d7dc41c8c4f52d12815396978f7bc75
@jfix71 jfix71 closed this as completed Sep 16, 2020
geoffberry pushed a commit to geoffberry/glow that referenced this issue Nov 8, 2020
Summary:
Documentation:

[Optional Fixes #issue]
Pull Request resolved: pytorch#4598

Test Plan: Please see a detailed explanation of how to fill out the fields in the relevant sections in PULL_REQUEST.md.

Reviewed By: gcatron

Differential Revision: D22049183

Pulled By: jfix71

fbshipit-source-id: fc8261bf4d7dc41c8c4f52d12815396978f7bc75
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