我试图导入以下模块
from fastai.nlp import *
from fastai.model import Stepper但是,我得到以下错误
ModuleNotFoundError: No module named 'fastai.nlp'
ModuleNotFoundError: No module named 'fastai.model'我已经安装了pip install fastai。
提前谢谢你的帮助。
发布于 2022-06-18 23:10:55
contain库不包含名为stepper或model的模块。对于NLP,您使用的是fastai.text模块,而不是fastai.nlp。这里有一个教程解释了如何:
https://docs.fast.ai/tutorial.text.html
您在哪里找到包含您要运行的两行代码的代码?这不是快速的v1或v2代码。也许是从part2课程开始的,在那里,像scratch这样的东西是从头开始重写的?https://course19.fast.ai/part2。如果是这样的话,你将需要从那里使用笔记本。
https://stackoverflow.com/questions/72430949
复制相似问题