Skip to content

run_classification_criteo遇到TypeError: Cannot convert a symbolic Keras input/output to a numpy array.问题 #462

@VinnyHu

Description

@VinnyHu

在运行run_classification_criteo.py 测试DeepFM模型时,遇到了TypeError: Cannot convert a symbolic Keras input/output to a numpy array. This error may indicate that you're trying to pass a symbolic value to a NumPy call, which is not supported. Or, you may be trying to pass Keras symbolic inputs/outputs to a TF API that does not register dispatching, preventing Keras from automatically converting the API call to a lambda layer in the Functional Model.

先是指出 run_classification_criteo.py中的 model = DeepFM(linear_feature_columns, dnn_feature_columns, task='binary')
然后指出 deepctr/models/deepfm.py中的 dnn_logit = tf.keras.layers.Dense(1, use_bias=False, kernel_initializer=tf.keras.initializers.glorot_normal(seed=seed))(dnn_output)

tf版本为2.6

请问这个可能是什么原因引起的?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions