case of multi input node base Tensorflow quantizer run error
rokmc612 opened this issue · comments
Hi,
compiled tensorflow framework at Jupyter environment. and I used by https://github.com/tegg89/SRCNN-Tensorflow sample code.
but, issued th error when compile to quantize run. for the sample tensorflow code have a couple of input node and one output node.
would you pls advice to multi input node case compile flow:
for the sample code
Step 2 result
Running with protoBuffer: /home/mluser/share/SRCNN-Tensorflow-master/checkpoint/srcnn_21/SRCNN.model/freeze_graph.pb
Running with quantInfo: /opt/models/tensorflow/quantization_fix_info.txt
Running with inputNode: images,labels
Running with outputNode: Mean
Running with inputShape: 33,33:21,21
Running with means: 104,107,123
Step 3. Run the Quantizer
!decent_q inspect --input_frozen_graph $protoBuffer
Op types used: 7 Const, 6 Identity, 3 Add, 3 Conv2D, 2 Placeholder, 2 Relu, 1 Mean, 1 Square, 1 Sub
Found 2 possible inputs: (name=images, type=float(1), shape=[?,33,33,1]) (name=labels, type=float(1), shape=[?,21,21,1])
Found 1 possible outputs: (name=Mean, op=Mean)
!decent_q quantize
--input_frozen_graph $protoBuffer
--input_nodes $inputNode
--output_nodes $outputNode
--input_shapes ?,$inputShape,1
--output_dir $MODELDIR
--input_fn util.input_fn
--method 1
--calib_iter 100
########################
len(shape_str)
3
########################
Traceback (most recent call last):
File "/usr/local/bin/decent_q", line 10, in
sys.exit(run_main())
File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/decent_q/python/decent_q.py", line 544, in run_main
app.run(main=my_main, argv=[sys.argv[0]] + unparsed)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 125, in run
_sys.exit(main(argv))
File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/decent_q/python/decent_q.py", line 543, in
my_main = lambda unused_args: main(unused_args, FLAGS)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/decent_q/python/decent_q.py", line 324, in main
input_shapes = _parse_input_shapes(input_nodes, flags.input_shapes)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/decent_q/python/decent_q.py", line 91, in _parse_input_shapes
'Input_shapes should be 4-dimension int shape list (support unknown batch_size), e.g. ?,224,224,3 or 1,299,299,3'
ValueError: Input_shapes should be 4-dimension int shape list (support unknown batch_size), e.g. ?,224,224,3 or 1,299,299,3