question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tensors must have same number of dimensions : got 5 and 3

See original GitHub issue

Hello @lucidrains @stevenwalton I have been trying to implement the standard ViT in 3d space and I have worked on some part of code ViT changed the Rearrange in patch embedding to as follows Rearrange('b e (h p1) (w p2) (d p3) -> b (e p1 p2 p3) h w d',p1=patch_size,p2=patch_size,p3=patch_size) and this patch embbeddings are passed to map with cls_tokens cls_tokens = repeat(self.cls_token, '() n e -> b n e', b=b) which throws an error due to dimensionality mismatch so how can i change the shape of cls_tokens to match the dimensionality of the patch_embeddings.

can you help me for getting solution to this problem Thanks & Regards Satwik Sunnam

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
satwiksunnam19commented, Oct 18, 2022

@satwiksunnam19 let me know if this helps https://github.com/lucidrains/vit-pytorch#3d-vit

@stevenwalton would be happy to offer a 3D CCT version, if you haven’t completed it already Satwik

@lucidrains I have completed the vit-3d model and it’s working good and i can add my vit-3d project to your GitHub , if you’re willing me to do so.

0reactions
satwiksunnam19commented, Nov 26, 2022
Read more comments on GitHub >

github_iconTop Results From Across the Web

pytorch DataLoader: `Tensors must have same number of ...
I am using 365 timesteps of X1 & X2 as features used to predict y . The dimensions of my training array is:...
Read more >
Tensors must have same number of dimensions: got 2 and 1
I am studying AI and now I am trying to understand and update a code which was made for older version of Pytorch....
Read more >
Tabular data: Tensors must have same number of dimensions
Hi there, I'm trying to do a binary classification but have a problem, Data: It's a tabular dataset, train: 90000 x 2, validation:...
Read more >
abhibongale/know-tensors-with-pytorch - Jovian
Non-empty tensors provided must have the same shape, except in the cat dimension. dim (int, optional) – the dimension over which the tensors...
Read more >
Torch Tensor
A Tensor is a potentially multi-dimensional matrix. The number of dimensions is unlimited that can be created using LongStorage with more dimensions. Example:....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found