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

Mask shape error in xder code implementation #12

Closed
oyt9306 opened this issue Apr 10, 2022 · 3 comments
Closed

Mask shape error in xder code implementation #12

oyt9306 opened this issue Apr 10, 2022 · 3 comments

Comments

@oyt9306
Copy link

oyt9306 commented Apr 10, 2022

Hello. Thank you for your recent work and for sharing xder code.

While I tried to reproduce your work on my one, I encountered a troublesome as follows.


File ".../models/xder.py", line 143, in update_logits
gt_values = old[torch.arange(len(gt)), gt]
IndexError: The shape of the mask [32] at index 0 does not match the shape of the indexed tensor [32, 10] at index 1

Have you ever met such problem? I'd like to ask you how to fix it. Thank you.

@mbosc
Copy link
Collaborator

mbosc commented Apr 10, 2022

Hello there,

I'm gonna need some more details to assess what's happening. (i) What dataset are you using? (is it one of ours?) (ii) what shape is the input tensor of the observe function?

@oyt9306 oyt9306 closed this as completed Apr 10, 2022
@oyt9306 oyt9306 reopened this Apr 10, 2022
@oyt9306
Copy link
Author

oyt9306 commented Apr 10, 2022

Thank you for your quick replying. First of all, I tried to run this code for a custom dataset with some modifications. After I examined the code with the cifar-100 dataset, the existing code works well with no troubleshooting. I will update the comment later if I meet the same problem after I look into the code. Thank you :D

@mbosc
Copy link
Collaborator

mbosc commented Apr 11, 2022

Ok, great!

Let me know if you have any trouble.

@mbosc mbosc closed this as completed Apr 11, 2022
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