10-15-2020 07:49 AM
Dear Staff,
Hello, I am quantizing my customized CNN model by Vitis-ai quantizer, however, it reports the error as following:
it seems like the quantizer misread my frozen model because it should be this for my max_pooling2d_1 layer:
how can it get an input of (512,1,32)?
I also evaluate my frozen model, it can run the model properly.
Can anyone help with this? Thank you very much!
The attached file is my frozen pb file
10-22-2020 06:22 AM
That's correct. I created a quantizer input file with random numpy data and passed that to the quantizer and it worked.
data=np.random.rand(100,512,4,1)
def calib_input(iter):
data_out=data[iter]
data_out=data_out.reshape(1,512,4,1)
return {"input":data_out}
Then specify this calib_input as the input function when you call the quantizer
10-21-2020 09:57 AM
Take a look at the documentation around the quantizer, specifically the input function. Although I can't test for accuracy I was able to get the quantizer to run by creating an input function that uses a (100, 512, 4, 1) numpy array of random data, based on the template and examples below:
https://www.xilinx.com/html_docs/vitis_ai/1_2/tensorflowversion.html#xuy1576231723436
10-21-2020 07:04 PM
do you mean this (100,512,4,1) input can run successfully for my pb file?
10-22-2020 06:22 AM
That's correct. I created a quantizer input file with random numpy data and passed that to the quantizer and it worked.
data=np.random.rand(100,512,4,1)
def calib_input(iter):
data_out=data[iter]
data_out=data_out.reshape(1,512,4,1)
return {"input":data_out}
Then specify this calib_input as the input function when you call the quantizer