cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
siliangz
Participant
Participant
322 Views
Registered: ‎01-07-2020

Error with quantizing tensorflow model using vai_q_tensorflow

I am using vai_q_tensorflow to quantize a tensorflow model. And I am migrating from DNNDK to Vitis AI. So the model I use could be quantized with decent_q. But I got following message when I try to use vai_q_tensorflow to quantize the model.  And I checked that there isn't a file called *conv_kernel_wquant under the temp folder. The model is exported in tensorflow 1.15 to avoid compatible issue.  Thanks ahead for your help. 

2020-07-20 15:59:30.516107: F tensorflow/contrib/decent_q/kernels/fix_neuron_ops.cc:36] Cannot open file: ./quantize_results/temp/StackedHourglass_stacks_stack_hourglass_0_hourglass_module_main_inner_main_exit_convBlock_conv_batch_norm_3_conv_batch_norm_3_conv_kernel_wquant for op: StackedHourglass/stacks/stack_hourglass_0/hourglass_module/main_inner/main_exit/convBlock/conv_batch_norm_3/conv_batch_norm_3_conv/kernel/wquant
Fatal Python error: Aborted

[Parameters]

vai_q_tensorflow quantize \
--input_nodes inputs \
--input_frozen_graph ${MODEL_PB} \
--input_shapes 1,256,256,1 \
--output_nodes {OUTPUT_NODE} \
--method 1 \
--input_fn graph_input_fn.calib_input_ \
--gpu 0 \
--calib_iter 1000 \
--output_dir ${OUTPUT_DIR}
0 Kudos
1 Reply
jasonwu
Moderator
Moderator
219 Views
Registered: ‎03-27-2013

Hi @siliangz ,

 

I would suggest you to double check your settings refer to: 

https://github.com/Xilinx/Vitis-AI/tree/v1.1/Tool-Example

and make sure you are using a frozen model(I am afraid that we only have VAI 1.1 examples for now):

https://github.com/gewuek/flower_classification_dnndk_v2/blob/master/x86/freeze_model.py

If it is still can't work. Is it possible to share your files for model quantization?

I would try to reproduce the issue on my side.

 

Best Regards,
Jason
-----------------------------------------------------------------------------------------------
Please mark the Answer as "Accept as solution" if the information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
-----------------------------------------------------------------------------------------------
0 Kudos