И остановился на этапе обучения модели именно с таким кодом:
Код: Выделить всё
model = WideDeep(
task="ranking",
data_info=data_info,
embed_size=16,
n_epochs=2,
loss_type="cross_entropy",
lr={"wide": 0.05, "deep": 7e-4},
batch_size=2048,
use_bn=True,
hidden_units=(128, 64, 32),
)
model.fit(
train_data,
neg_sampling=True, # perform negative sampling on training and eval data
verbose=2,
shuffle=True,
eval_data=eval_data,
metrics=["loss", "roc_auc", "precision", "recall", "ndcg"],
)
Код: Выделить всё
TypeError: Exception encountered when calling Flatten.call().
Failed to convert elements of (Dimension(None), Dimension(80)) to Tensor. Consider casting elements to a supported type. See https://www.tensorflow.org/api_docs/python/tf/dtypes for supported TF dtypes.
Arguments received by Flatten.call():
• inputs=tf.Tensor(shape=(?, 5, 16), dtype=float32)
Я работаю в среде PyCharm и использую блокноты Jupyter.
Подробнее здесь: https://stackoverflow.com/questions/787 ... -to-tensor