mathAI
mathAI copied to clipboard
TypeError: data must be either a numpy array or pandas DataFrame if pandas is installed; got dict
环境都已经建好
因为没有您说的opencv版本号 所以用pip install opencv-python==3.4.17.63下载 但在run main.py时出现以下的错误
TypeError: data must be either a numpy array or pandas DataFrame if pandas is installed; got dict
错误是发生在main.py的 for i,p in enumerate(predictions):
estimator.py的 features, input_hooks = self._get_features_from_input_fn(input_fn, ModeKeys.PREDICT)
你能把错误贴完全一点吗?感觉你是不是tensorflow版本没有安装对啊?
不好意思 这是完整的错误讯息
2022-05-11 18:02:31.429282: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found 2022-05-11 18:02:31.451464: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine. INFO:tensorflow:Using default config. INFO:tensorflow:Using config: {'_model_dir': './my_cnn_model_config5', '_tf_random_seed': None, '_save_summary_steps': 100, '_save_checkpoints_steps': None, '_save_checkpoints_secs': 600, '_session_config': allow_soft_placement: true graph_options { rewrite_options { meta_optimizer_iterations: ONE } } , '_keep_checkpoint_max': 5, '_keep_checkpoint_every_n_hours': 10000, '_log_step_count_steps': 100, '_train_distribute': None, '_device_fn': None, '_protocol': None, '_eval_distribute': None, '_experimental_distribute': None, '_experimental_max_worker_delay_secs': None, '_session_creation_timeout_secs': 7200, '_checkpoint_save_graph_def': True, '_service': None, '_cluster_spec': ClusterSpec({}), '_task_type': 'worker', '_task_id': 0, '_global_id_in_cluster': 0, '_master': '', '_evaluation_master': '', '_is_chief': True, '_num_ps_replicas': 0, '_num_worker_replicas': 1} WARNING:tensorflow:From C:\Python\Python39\lib\site-packages\tensorflow\python\util\lazy_loader.py:63: The name tf.estimator.inputs is deprecated. Please use tf.compat.v1.estimator.inputs instead.
WARNING:tensorflow:From c:\mathAI-master\source_code\main.py:47: The name tf.estimator.inputs.pandas_input_fn is deprecated. Please use tf.compat.v1.estimator.inputs.pandas_input_fn instead.
<generator object Estimator.predict at 0x0000013DD80A4EB0>
type(input_fn) : <class 'function'>
input_fn : <function pandas_input_fn.