use*_*077 9 python pipeline python-3.x huggingface-transformers anaconda3
我已经安装了pytorchwithconda和transformerswith pip.
我可以import transformers毫无问题,但当我尝试时,import pipeline from transformers我得到一个例外:
from transformers import pipeline
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-4-69a9fd07ccac> in <module>
----> 1 from transformers import pipeline
ImportError: cannot import name 'pipeline' from 'transformers' (C:\Users\Alienware\Anaconda3\envs\tf2\lib\site-packages\transformers\__init__.py)
Run Code Online (Sandbox Code Playgroud)
这是搜索init .py 文件的目录视图:
是什么导致了这个问题?我该如何解决它?