首页 > 解决方案 > 如何将 Keras 张量转换为 numpy 数组

问题描述

我正在努力将一个简单的 Keras 张量转换为一个 Numpy 数组。这是我要执行的代码:

input = tf.keras.Input(shape=(100, 1), name='input')
inputs = np.array(input) 

错误:Cannot convert a symbolic Keras input/output to a numpy array.

标签: pythonnumpytensorflowkeras

解决方案


推荐阅读