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

Tensor wrong shape (swag) #479

Closed
klxiao opened this issue Mar 5, 2019 · 2 comments
Closed

Tensor wrong shape (swag) #479

klxiao opened this issue Mar 5, 2019 · 2 comments

Comments

@klxiao
Copy link

klxiao commented Mar 5, 2019

I tried following the instructions in @38 but ran into the following bug when computing the tensors:
ValueError: Cannot reshape a tensor with 128 elements to shape [8,4] (32 elements) for 'loss/Reshape' (op: 'Reshape') with input shapes: [32,4], [2] and with input tensors computed as partial shapes: input[1] = [8,4].

To note, my input_ids/input_masks/segment_id's all have shape [4,max_seq_length], my model_fn rehapes to [32, max_seq_length], and I used the exact code for computing logits as run_classifier.py except that I reshaped logits to be [8,4], which resulted in the aforementioned error.

@klxiao klxiao closed this as completed Mar 7, 2019
@klxiao
Copy link
Author

klxiao commented Mar 7, 2019

Resolved!

@omerarshad
Copy link

@klxiao can you please share your code?

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

2 participants