股票预测案例中model.fit 运行错误,咋回事呢?
来源:9-6 实战(二)RNN股价预测
种草郭橐驼
2022-06-21
之前程序没有问题:
错误信息:
ValueError Traceback (most recent call last)
C:\Users\ADMINI~1\AppData\Local\Temp/ipykernel_3176/2240817477.py in <module>
1 #train the model
----> 2 model.fit(X,y,batch_size=30,epochs=200)
C:\anaconda3\lib\site-packages\keras\utils\traceback_utils.py in error_handler(*args, **kwargs)
65 except Exception as e: # pylint: disable=broad-except
66 filtered_tb = _process_traceback_frames(e.__traceback__)
---> 67 raise e.with_traceback(filtered_tb) from None
68 finally:
69 del filtered_tb
C:\anaconda3\lib\site-packages\keras\engine\data_adapter.py in select_data_adapter(x, y)
983 if not adapter_cls:
984 # TODO(scottzhu): This should be a less implementation-specific error.
--> 985 raise ValueError(
986 "Failed to find data adapter that can handle "
987 "input: {}, {}".format(
ValueError: Failed to find data adapter that can handle input: <class 'numpy.ndarray'>, (<class 'list'> containing values of types {"<class 'numpy.float64'>"})
写回答
1回答
-
flare_zhao
2022-06-21
检查下你的X和y的值,然后重新启动下软件重新运行试下
052022-06-22