Debug Tensorflow: TypeError: Cannot convert a symbolic Keras input/output to a numpy array.
生活随笔
收集整理的這篇文章主要介紹了
Debug Tensorflow: TypeError: Cannot convert a symbolic Keras input/output to a numpy array.
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
問題
'Cannot convert a symbolic Keras input/output to a numpy array. ’
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.
解決
- 檢查numpy tensorflow版本是否符合要求
- 我這里是import的問題
修改為
from tensorflow.keras.layers import Input, Lambda, Dense,我的問題解決
總結
以上是生活随笔為你收集整理的Debug Tensorflow: TypeError: Cannot convert a symbolic Keras input/output to a numpy array.的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 机器学习实战:训练自己的YoloV5 [
- 下一篇: MyBatis 解决模糊查询包含特殊字符