预测时报错Feed operators in program desc do not match 'feed_targets' 但train和test的reader结构一致
Created by: na-gi
-
版本、环境信息: 1)PaddlePaddle版本:1.5.1 2)使用CPU 3)环境:aistudio基础版环境,python3
-
问题描述: 据了解这个报错是“reader返回的数据与定义的数量不一致”的意思,但我有关reader和feeder的代码结构是一致的,不清楚问题出在哪里?
-
报错信息: /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/executor.py in run(self, program, feed, fetch_list, feed_var_name, fetch_var_name, scope, return_numpy, use_program_cache) 649 scope=scope, 650 return_numpy=return_numpy, --> 651 use_program_cache=use_program_cache) 652 else: 653 if fetch_list and program._is_data_parallel and program._program and ( /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/executor.py in _run(self, program, exe, feed, fetch_list, feed_var_name, fetch_var_name, scope, return_numpy, use_program_cache) 743 fetch_list=fetch_list, 744 feed_var_name=feed_var_name, --> 745 fetch_var_name=fetch_var_name) 746 747 self._feed_data(program, feed, feed_var_name, scope) /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/executor.py in _add_feed_fetch_ops(self, program, feed, fetch_list, feed_var_name, fetch_var_name) 417 418 # prepend feed operators --> 419 if not has_feed_operators(global_block, feed, feed_var_name): 420 for i, name in enumerate(feed): 421 out = global_block.var(name) /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/executor.py in has_feed_operators(block, feed_targets, feed_holder_name) 161 if feed_count > 0 and feed_count != len(feed_targets): 162 raise Exception( --> 163 "Feed operators in program desc do not match 'feed_targets'") 164 return feed_count > 0 165 Exception: Feed operators in program desc not match 'feed_targets'