【发布时间】:2021-08-27 03:54:27
【问题描述】:
我正在尝试进行多变量时间序列预测,但是当我调用 model.predict(input_x, verbose=1) 时它会返回
UnimplementedError: Cast string to float is not supported
[[node sequential_5/Cast (defined at <ipython-input-6-ebf024c56d89>:111) ]] [Op:__inference_predict_function_78009]
Function call stack:
predict_function
但是,当我打印出 input_x 和 type(input_x) 时,我得到了
[[['Signal_1']
['Signal_2']
['Signal_3']
['Signal_4']
['Signal_5']]]
<class 'numpy.ndarray'>
根据Tensorflow documentation,这应该是可接受的输入形式:
输入样本。它可能是: 一个 Numpy 数组(或类似数组),或一个数组列表(如果模型有多个输入)
【问题讨论】:
-
你确定输入的是数字
-
“Signal_1”代表什么?只是一个字符串?还是应该是数组名甚至文件名?
-
信号 1-5 的名称是我要使用的 CSV 数据的列名
标签: python numpy tensorflow machine-learning numpy-ndarray