本地Mac的Jupyter与Kaggle运行fastai表格代码结果差异排查
本地运行fastai成人样本代码训练准确率为0的问题
我在运行fastbook第一章的示例代码,但在Mac本地的Jupyter或VSCode内核中运行以下代码时,训练准确率始终为0.00000,和Kaggle上运行完全相同代码的结果存在明显差异。
代码如下:
from fastai.tabular.all import * path = untar_data(URLs.ADULT_SAMPLE) dls = TabularDataLoaders.from_csv(path/'adult.csv', path=path, y_names="salary", cat_names = ['workclass', 'education', 'marital-status', 'occupation', 'relationship', 'race'], cont_names = ['age', 'fnlwgt', 'education-num'], procs = [Categorify, FillMissing, Normalize]) learn = tabular_learner(dls, metrics=accuracy)
learn.fit_one_cycle(3)
本地Jupyter输出:
Kaggle输出:
如您所见,本地训练的所有轮次准确率均为0.00。我忽略了什么?
内容的提问来源于stack exchange,提问作者epicwhale
相关产品推荐
相关产品推荐

