我正试图在 Windows 10 上安装 fastai。
我的笔记本没有 GPU,所以我正在使用 cmd 中的 pip 安装 fastai。
在 pip 页面上,他们提到在安装 fastai 之前要先安装 pytorch。
我遵循了这个步骤,
关于pytorch-
pip install torch==1.6.0+cpu torchvision==0.7.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
然后,对于fastai:
pip install fastai
这些Python包已经成功安装。
from fastai.vision import *
成功导入了fastai.vision模块,
但是当我使用ImageDataBunch函数时,
data = ImageDataBunch.from_folder(path, train=".", valid_pct=0.2, size=512, bs=4, seed=24)
它显示错误,NameError: name 'ImageDataBunch' is not defined
我不知道发生了什么事情,请您帮助我解决这个错误,谢谢。
类型对象“Image”没有属性“size”
- Resham Wadhwa