ModulenotFoundError:No模块名为' fastai.nlp'
我尝试导入以下模块
from fastai.nlp import *
from fastai.model import Stepper
,但是,我会收到以下错误,
ModuleNotFoundError: No module named 'fastai.nlp'
ModuleNotFoundError: No module named 'fastai.model'
我已经安装了pip安装fastai
。
事先感谢您的帮助。
I tried to import the following modules
from fastai.nlp import *
from fastai.model import Stepper
But, I get the following error
ModuleNotFoundError: No module named 'fastai.nlp'
ModuleNotFoundError: No module named 'fastai.model'
I have already install pip install fastai
.
Thanks in advance for your help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Fastai库不包含称为
步进
或模型
的模块。对于NLP,您使用fastai.text
模块,而不是fastai.nlp
。这是一个教程,说明:https://docs.fast.fast.ai/tutorial.tutorial.text.text.html < /a>
您在哪里找到包含您要运行的两行的代码?它不是Fastai V1或V2代码。也许是从Part2课程开始,像Fastai这样的东西是从头开始重写的? https://course19.fast.fast.ai/part2 。如果是这样,您需要从那里使用笔记本。
The fastai library does not contain modules called
stepper
ormodel
. For NLP you use thefastai.text
modules, notfastai.nlp
. Here's a tutorial explaining how:https://docs.fast.ai/tutorial.text.html
Where did you find code containing the two lines you're trying to run? It's not fastai v1 or v2 code. Perhaps it's from the part2 course where something like fastai was rewritten from scratch? https://course19.fast.ai/part2. If so, you'll need to use the notebooks from there.