使用以下代码为人口普查数据集训练python模型时: https://gist.github.com/gaganmalhotra/8c40e7650f27cf3f894bad092fbe01ab
我成功地用python训练/保存并加载模型。在
但是对于使用预测器进行预测,它会产生如下错误:
ValueError: Got unexpected keys in input_dict: set(['workclass', 'gender', 'marital_status', 'race', 'native_country', 'education', 'occupation'])
当传递给模型的数据只包含这些张量时,可以在我上面分享的要点中找到它的代码。另请参阅下面的片段-
^{pr2}$我不确定,因为只有这些特征用于训练数据,现在我们正在使用相同的特征进行预测。
@灰烬
目前没有回答
相关问题 更多 >
编程相关推荐