gpt4 book ai didi

fast-ai - 快速艾 : AttributeError: 'Learner' object has no attribute 'fine_tune'

转载 作者:行者123 更新时间:2023-12-04 14:39:34 26 4
gpt4 key购买 nike

Fast Ai采用了一种非常规的风格from fastai import *等等。
我不喜欢它,所以我煞费苦心地识别 chapter 2 of the fastai book 中的每个导入但遇到了错误

AttributeError: 'Learner' object has no attribute 'fine_tune'
然而,当我然后去做
from fastbook import *
有用。这是一个非常奇怪的行为,因为如果上述导入完成,则对 cnn_learner 类或包含它的模块进行了某些操作,使其具有 Fine_tune 方法。
我想避免这种编码风格,那么我应该怎么做才能加载正确版本的 Learner?

最佳答案

我刚刚面临完全相同的问题。看了他们的一个教程后,我发现 cnn 学习器不是从预期的包中导入的。

from fastai.vision.all import cnn_learner
# rather than
from fastai.vision.learner import cnn_learner
调用 fine_tune方法然后按预期工作!

关于fast-ai - 快速艾 : AttributeError: 'Learner' object has no attribute 'fine_tune' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65128126/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com