Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
VinnyHu opened this issue May 10, 2022 · 2 comments

Comments

@VinnyHu
Copy link

VinnyHu commented May 10, 2022

在运行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

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

@cservan
Copy link

cservan commented Jun 3, 2022

Dear All,
I have the same issue with the example "run_regression_movielens.py"...
Any idea to solve it?

Best

@shenweichen
Copy link
Owner

This is due to version incompatibility of numpy , you can use pip install numpy==1.19.5 to reinstall

@shenweichen shenweichen pinned this issue Jun 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants