---
title: 校准时提示“Invalid argument: You must feed a value for placeholder tensor **”
description: "训练后量化场景，修改模型后执行校准过程时，使用原始模型的输入输出做推理，报错提示必须给一个占位符输入数据，校准过程中断。提示信息如下："
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/devaids/amct/atlasamct_16_0366.html
sourcePath: /source/zh/canncommercial/900/devaids/amct/atlasamct_16_0366.html
indexId: 3b13945c1ccf5a523470965ddfd0039f85c73d4467492330964a030a7eb3487665
---
# 校准时提示“Invalid argument: You must feed a value for placeholder tensor **”

#### 问题现象描述

训练后量化场景，修改模型后执行校准过程时，使用原始模型的输入输出做推理，报错提示必须给一个占位符输入数据，校准过程中断。提示信息如下：

```
Traceback (most recent call last):
  File "xxx/site-packages/tensorflow_core/python/client/session.py", line 1365, in _do_call
    return fn(*args)
  File "xxx/site-packages/tensorflow_core/python/client/session.py", line 1350, in _run_fn
    target_list, run_metadata
  File "xxx/site-packages/tensorflow_core/python/client/session.py", line 1443, in _call_tf_sessionrun
    run_metadata
tensorflow.python.framework.errors_impl.InvalidArgumentError: 2 root error(s) found.
  (0) Invalid argument: You must feed a value for placeholder tensor 'input' with dtype float and shape [1,32,32,10]
         [[{{node input}}]]
         [[ConstantFoldingCtrl/conv1/search_n_quant/search_n_quant_SEARCHN/cond/Switch_0/_22]]
  (1) Invalid argument: You must feed a value for placeholder tensor 'input' with dtype float and shape [1,32,32,10]
         [[{{node input}}]]
```


#### 原因分析

调用quantize_model处理用户的图结构时，会进行融合、替换等图操作，可能改变用户模型的输出，将原有的输出节点与placeholder连接。


#### 解决措施

该场景下调用quantize_model时，会有warning信息提示输出节点发生变化，在执行校准的过程中，根据提示信息，修改输出节点即可。
