tensor.H is only supported on matrices (2-D tensors). Got 1-D tensor

Hello folks, I ran into problem that not even allowing me to execute any of my code after import statements:

from fastai2.text.all import *


def app():
    print('Hello')


if __name__ == '__main__':
    app()

I’m getting:

RuntimeError: tensor.H is only supported on matrices (2-D tensors). Got 1-D tensor.

Full stacktrace:

/home/vsaik/projects/diary/sentiment/venv/bin/python /home/vsaik/projects/diary/sentiment/main.py
Traceback (most recent call last):
  File "/home/vsaik/projects/diary/sentiment/main.py", line 1, in <module>
    from fastai2.text.all import *
  File "/home/vsaik/projects/diary/sentiment/venv/lib/python3.8/site-packages/fastai2/text/all.py", line 1, in <module>
    from ..basics import *
  File "/home/vsaik/projects/diary/sentiment/venv/lib/python3.8/site-packages/fastai2/basics.py", line 1, in <module>
    from .data.all import *
  File "/home/vsaik/projects/diary/sentiment/venv/lib/python3.8/site-packages/fastai2/data/all.py", line 1, in <module>
    from ..torch_basics import *
  File "/home/vsaik/projects/diary/sentiment/venv/lib/python3.8/site-packages/fastai2/torch_basics.py", line 4, in <module>
    from .torch_core import *
  File "/home/vsaik/projects/diary/sentiment/venv/lib/python3.8/site-packages/fastai2/torch_core.py", line 312, in <module>
    _patch_tb()
  File "/home/vsaik/projects/diary/sentiment/venv/lib/python3.8/site-packages/fastai2/torch_core.py", line 308, in _patch_tb
    f = getattr(t, fn)
RuntimeError: tensor.H is only supported on matrices (2-D tensors). Got 1-D tensor.

I’m using:
Ubuntu 20.04.4 LTS 64-bit
PyCharm Pro with:
Python 3.8.10
IPython 8.4.0
pip 21.3.1
torch 1.11.0
fastai2 0.0.30
numpy 1.22.4

What could be the reason for such error? Does anyone faced same problem? How to fix it?

Would be helpful for any kind of advice!

1 Like

I am also facing the same problem while practicing the pets breed classification class. Please let me know if you’ve found out the solution to this.

same here having this problem using google colab and jupyter

I myself have been using Google Colab. Hoping that someone might have the answer.