ModulenotFoundError:No模块名为' fastai.nlp'

发布于 2025-02-02 18:07:21 字数 305 浏览 4 评论 0原文

我尝试导入以下模块

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

甜点 2025-02-09 18:07:21

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 or model. For NLP you use the fastai.text modules, not fastai.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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文