Why Is the Message "Invalid argument: You must feed a value for placeholder tensor **" Displayed During Calibration?
Symptom
In the PTQ process, after original model configuration, inference is run with the source inputs and outputs for calibration, but the calibration terminates with an error message indicating that a placeholder is required. The message is as follows:
1 2 3 4 5 6 7 8 9 10 11 12 13 | 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}}]] |
Possible Cause
When the quantize_model API is called to process your graph, operations such as fusion and replacement are performed, which may change the output node of your model, for example, connecting the output node to a placeholder.
Solution
When the quantize_model API is called, a warning message will be displayed upon output node changes. During the calibration, modify the output node as prompted.
Parent topic: FAQs