EinopsError raised
See original GitHub issueAfter uploading a picture, this error is raised:
File "C:\Users\zhang\anaconda3\lib\site-packages\einops\einops.py", line 418, in reduce
raise EinopsError(message + '\n {}'.format(e))
einops.EinopsError: Error while processing rearrange-reduction pattern "b n (h d) -> b h n d".
Input tensor shape: torch.Size([1, 512]). Additional info: {'h': 8}.
Expected 3 dimensions, got 2
This error also appears on google colab:
Saving Screenshot 2022-07-12 113227.png to Screenshot 2022-07-12 113227.png
---------------------------------------------------------------------------
EinopsError Traceback (most recent call last)
[/usr/local/lib/python3.7/dist-packages/einops/einops.py](https://localhost:8080/#) in reduce(tensor, pattern, reduction, **axes_lengths)
409 recipe = _prepare_transformation_recipe(pattern, reduction, axes_lengths=hashable_axes_lengths)
--> 410 return _apply_recipe(recipe, tensor, reduction_type=reduction)
411 except EinopsError as e:
17 frames
EinopsError: Expected 3 dimensions, got 2
During handling of the above exception, another exception occurred:
EinopsError Traceback (most recent call last)
[/usr/local/lib/python3.7/dist-packages/einops/einops.py](https://localhost:8080/#) in reduce(tensor, pattern, reduction, **axes_lengths)
416 message += '\n Input is list. '
417 message += 'Additional info: {}.'.format(axes_lengths)
--> 418 raise EinopsError(message + '\n {}'.format(e))
419
420
EinopsError: Error while processing rearrange-reduction pattern "b n (h d) -> b h n d".
Input tensor shape: torch.Size([1, 512]). Additional info: {'h': 8}.
Expected 3 dimensions, got 2
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How to use the einops.einops.EinopsError function in einops
3: raise EinopsError('Expression may contain dots only inside ellipsis (...); only one ellipsis for tensor ') expression = expression.replace('.
Read more >EinopsError: Error while processing rearrange-reduction ...
Raises the error: EinopsError: Error while processing rearrange-reduction pattern "(b1 b2) h w c -> (b1 h) (b2 w) c".
Read more >einops.reduce
einops.reduce provides combination of reordering and reduction using reader-friendly notation. Examples for reduce operation: >>> x = ...
Read more >einops.EinopsError Example - Program Talk
def _report_axes(axes: set, report_message: str): if len(axes) > 0: raise EinopsError(report_message.format(axes)) class WeightedEinsumMixin:.
Read more >einops - Rust - Docs.rs
Almost all the operations specified in its tutorial should be available, if you find any inconsistencies please raise a github issue.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
In https://github.com/rwightman/pytorch-image-models/blob/master/timm/models/vision_transformer.py The default value of parameter global_pool of VisionTransformer is “token”
So we can add an argument (global_pool=“”) to construct CustomVisionTransformer in “hybrid.py”, like this
Will push the update to pypi when I get home. Until then you can call
Edit: Done