本文介绍了Tensorflow 数据适配器错误:ValueError:无法找到可以处理输入的数据适配器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在运行加密货币 RNN 的 senddex 教程脚本时,请在此处链接
While running a sentdex tutorial script of a cryptocurrency RNN, link here
但在尝试训练模型时遇到错误.我的 tensorflow 版本是 2.0.0,我正在运行 python 3.6.尝试训练模型时,我收到以下错误:
but have encountered an error when attempting to train the model. My tensorflow version is 2.0.0 and I'm running python 3.6. When attempting to train the model I receive the following error:
File "C:python36-64libsite-packages ensorflow_corepythonkerasengine raining.py", line 734, in fit
use_multiprocessing=use_multiprocessing)
File "C:python36-64libsite-packages ensorflow_corepythonkerasengine raining_v2.py", line 224, in fit
distribution_strategy=strategy)
File "C:python36-64libsite-packages ensorflow_corepythonkerasengine raining_v2.py", line 497, in _process_training_inputs
adapter_cls = data_adapter.select_data_adapter(x, y)
File "C:python36-64libsite-packages ensorflow_corepythonkerasenginedata_adapter.py", line 628, in select_data_adapter
_type_name(x), _type_name(y)))
ValueError: Failed to find data adapter that can handle input: <class 'numpy.ndarray'>, (<class 'list'> containing values of types {"<class 'numpy.float64'>"})
任何建议将不胜感激!
推荐答案
你有没有检查过你的训练/测试数据和训练/测试标签是否都是 numpy 数组?可能是您将 numpy 数组与列表混合在一起.
Have you checked whether your training/testing data and training/testing labels are all numpy arrays? It might be that you're mixing numpy arrays with lists.
这篇关于Tensorflow 数据适配器错误:ValueError:无法找到可以处理输入的数据适配器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!