我试图用估计器进行预测,但我得到了以下错误:
ValueError: Value Tensor("normalize_element/component_0:0", shape=(), dtype=int32, device=/device:CPU:0) has insufficient rank for batching.
pred = {"Team1":10764 ,
"Team1Rank":51,
"Team1Prediction":17,
"Team2":8211,
"Team2Rank":81,
"Team2Prediction":1,
"Odds1":1.3,
"Odds2":3.2,
"BestOf":3
}
def pred_fn(features, batch_size=960):
db = tf.data.Dataset.from_tensor_slices((dict(features))).batch(batch_size)
return db
predictions = classifier.predict(
input_fn=lambda: pred_fn(pred))
print(list(predictions))
我遵循标准指南,尝试不同的事情,但没有任何效果
以下更改修复了该问题
到
相关问题 更多 >
编程相关推荐