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

Error in fx.select #14

Open
tfc-0 opened this issue Sep 21, 2023 · 0 comments
Open

Error in fx.select #14

tfc-0 opened this issue Sep 21, 2023 · 0 comments

Comments

@tfc-0
Copy link

tfc-0 commented Sep 21, 2023

Hi, I have run the same code, but got this error in this line.

For input:

from compact_bilinear_pooling import CountSketch, CompactBilinearPooling

input_size = 2048
output_size = 16000
mcb = CompactBilinearPooling(input_size, input_size, output_size).cuda()
x = torch.rand(4,input_size).cuda()
y = torch.rand(4,input_size).cuda()

z = mcb(x,y)

Output error:

Traceback (most recent call last):
  File "/compact_bilinear_pooling.py", line 273, in <module>
    z = mcb(x,y)
  File "/python3.9/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "compact_bilinear_pooling.py", line 263, in forward
    return CompactBilinearPoolingFn.apply(self.sketch1.h, self.sketch1.s, self.sketch2.h, self.sketch2.s, self.output_size, x, y, self.force_cpu_scatter_add)
  File "/python3.9/site-packages/torch/autograd/function.py", line 506, in apply
    return super().apply(*args, **kwargs)  # type: ignore[misc]
  File "/compact_bilinear_pooling.py", line 154, in forward
    im_fx = fx.select(-1, 1)
IndexError: select(): index 1 out of range for tensor of size [2, 1] at dimension 1
@tfc-0 tfc-0 changed the title Error is select Error in select Sep 21, 2023
@tfc-0 tfc-0 changed the title Error in select Error in fx.select Sep 21, 2023
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

1 participant