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

Dimension error for geometric and appearance features in Relation Encoding #3

Closed
Jian-Xi opened this issue Mar 31, 2020 · 1 comment

Comments

@Jian-Xi
Copy link

Jian-Xi commented Mar 31, 2020

Thanks for sharing the codes. It's solid organized and compact programmed.

I'd like to have two questions about the RelationTransformerModel.py based on my running results.

  1. Code at llne 454, after this compare operation, we got a array with boolean indexes which can not be added in the following line, i changed it
    seq_mask = (seq.data > 0) to seq_mask = (seq.data > 0).type(torch.int8)
    It's quiet thereafter.

  2. In the function box_attention at line 236,
    # multiplying log of geometric weights by feature weights w_mn = torch.log(torch.clamp(w_g, min = 1e-6)) + w_a

the dimensions of these two geometric and appearance features are not matched. Thus I got error as follows:

RuntimeError: The size of tensor a (54) must match the size of tensor b (50) at non-singleton dimension 3

I've tried to figure it out what's going on there quite for a while but got no idea as so far. I'm not sure whether it depends on my environments (I think not) or it's just a typo in coding.

  • torch 0.4.1
  • torchvision 0.2.1
  • 4 x Tesla V100-SXM2 Driver Version: 410.104 CUDA Version: 10.0

Any input will be appreciated.
Jian

@Jian-Xi Jian-Xi changed the title Dimension error for geometic and appearance features in Relation Encoding Dimension error for geometric and appearance features in Relation Encoding Mar 31, 2020
@Jian-Xi
Copy link
Author

Jian-Xi commented Apr 13, 2020

The model structure is not designed for multiple devices. It can be launched just on single GPU. All the relation box modules use the same inputs( same length) to calculate the geo plus appearance features. If the batch data got chunked and scattered on different devices. it leads to dimension problem.

@Jian-Xi Jian-Xi closed this as completed Apr 13, 2020
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