为什么HF_TASKS_AUTO未从Fastai识别?
这是我这样做的
!pip install ohmeow-blurr==0.0.6
!pip install datasets==1.3.0 -qq
!pip install fsspec==2021.7.0
是我尝试使用fastai2的库导入的库
import ast
import torch
from fastai.text.all import *
from transformers import *
from blurr.data.all import *
from blurr.modeling.all import *
,但这是我收到的错误
RuntimeError Traceback (most recent call last)
Input In [16], in <cell line: 3>()
1 import ast
2 import torch
----> 3 from fastai2.text.all import *
4 from transformers import *
8 from blurr.data.all import *
File ~\anaconda3\lib\site-packages\fastai2\text\all.py:1, in <module>
----> 1 from ..basics import *
2 from ..callback.all import *
3 from .core import *
File ~\anaconda3\lib\site-packages\fastai2\basics.py:1, in <module>
----> 1 from .data.all import *
2 from .optimizer import *
3 from .callback.core import *
File ~\anaconda3\lib\site-packages\fastai2\data\all.py:1, in <module>
----> 1 from ..torch_basics import *
2 from .core import *
3 from .load import *
File ~\anaconda3\lib\site-packages\fastai2\torch_basics.py:4, in <module>
2 from .imports import *
3 from .torch_imports import *
----> 4 from .torch_core import *
5 from .layers import *
File ~\anaconda3\lib\site-packages\fastai2\torch_core.py:312, in <module>
309 if isinstance(f, (MethodWrapperType, BuiltinFunctionType, BuiltinMethodType, MethodType, FunctionType)):
310 setattr(TensorBase, fn, get_f(fn))
--> 312 _patch_tb()
314 # Cell
315 class TensorCategory(TensorBase): pass
File ~\anaconda3\lib\site-packages\fastai2\torch_core.py:308, in _patch_tb()
306 for fn in dir(t):
307 if fn in skips: continue
--> 308 f = getattr(t, fn)
309 if isinstance(f, (MethodWrapperType, BuiltinFunctionType, BuiltinMethodType, MethodType, FunctionType)):
310 setattr(TensorBase, fn, get_f(fn))
RuntimeError: tensor.H is only supported on matrices (2-D tensors). Got 1-D tensor.
是我想添加的任务,但无法以某种方式
task = HF_TASKS_AUTO.TokenClassification
对此我从上面的代码
This is PIP install that I did
!pip install ohmeow-blurr==0.0.6
!pip install datasets==1.3.0 -qq
!pip install fsspec==2021.7.0
This is the library imports that I did
import ast
import torch
from fastai.text.all import *
from transformers import *
from blurr.data.all import *
from blurr.modeling.all import *
I tried using fastai2 but this is the error that I get
RuntimeError Traceback (most recent call last)
Input In [16], in <cell line: 3>()
1 import ast
2 import torch
----> 3 from fastai2.text.all import *
4 from transformers import *
8 from blurr.data.all import *
File ~\anaconda3\lib\site-packages\fastai2\text\all.py:1, in <module>
----> 1 from ..basics import *
2 from ..callback.all import *
3 from .core import *
File ~\anaconda3\lib\site-packages\fastai2\basics.py:1, in <module>
----> 1 from .data.all import *
2 from .optimizer import *
3 from .callback.core import *
File ~\anaconda3\lib\site-packages\fastai2\data\all.py:1, in <module>
----> 1 from ..torch_basics import *
2 from .core import *
3 from .load import *
File ~\anaconda3\lib\site-packages\fastai2\torch_basics.py:4, in <module>
2 from .imports import *
3 from .torch_imports import *
----> 4 from .torch_core import *
5 from .layers import *
File ~\anaconda3\lib\site-packages\fastai2\torch_core.py:312, in <module>
309 if isinstance(f, (MethodWrapperType, BuiltinFunctionType, BuiltinMethodType, MethodType, FunctionType)):
310 setattr(TensorBase, fn, get_f(fn))
--> 312 _patch_tb()
314 # Cell
315 class TensorCategory(TensorBase): pass
File ~\anaconda3\lib\site-packages\fastai2\torch_core.py:308, in _patch_tb()
306 for fn in dir(t):
307 if fn in skips: continue
--> 308 f = getattr(t, fn)
309 if isinstance(f, (MethodWrapperType, BuiltinFunctionType, BuiltinMethodType, MethodType, FunctionType)):
310 setattr(TensorBase, fn, get_f(fn))
RuntimeError: tensor.H is only supported on matrices (2-D tensors). Got 1-D tensor.
This is the task that I wanted to add but somehow not being able to
task = HF_TASKS_AUTO.TokenClassification
This the error that I get from the code above
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
必须更新API才能在Kaggle上工作...您应该能够从
get_hf_objects
中使用utils
module ...The API had to be updated to work on kaggle ... you should be able to simply use
get_hf_objects
from theutils
module ...