-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IndexError: list index (1) out of range--------calibrator.Calibrator.export_coefficient_to_cpp (AIV-410) #59
Comments
@Auroragan @yehangyang
|
Hi @PureHing not sure what you think as more friendly, both depthwise_conv2d and conv2d are optimized on S3. you can choose based on your application. |
@Auroragan According to the error prompt:
I don't know which list is out of range. |
yeah ok, it's a bug for exporting leakyrelu activation, will fix it soon |
@PureHing Yeah,It‘s right. |
@TiramisuJ |
Sure,the image channel conversion from 320x320x1 to 1x320x320 doesn’t change the data arangement, you can just change the shape of the Tensor from [320, 320, 1] to [1, 320, 320]. |
@PureHing The new version has been pushed. you can try it |
@TiramisuJ @Auroragan the newest version didn't have any changes for my model. |
There should be some differences about the value in the exported cpp? Yes you can cut off the reshape and transpose layer. For the input, you don’t need to do any change, because for our library the input dimensions for conv should be [height, width, channel], so if you have the array of image data for example:
For the output, the dimensions are also in the same sequence as above |
@Auroragan Thanks much. Got it! |
@Auroragan BTW, How is the |
You don’t need to specify dst_height because it’s scaling the width and height with an equal ratio |
@Auroragan my model is calibrated by using
FP32 model: if the input image preprocess is img= (img-mean)/std |
Our face detect model is using 16-bit quantization, don’t need to convert the input type if you want to use 8-bit quantization, you can normalized your input image first as what you did for your original model and then times 2^-input_exponent to be the int8 input tensor, or you can also simplify this calculation based on the normalization method you used |
@Auroragan |
sorry cannot evaluate the exact time.
is this the inference time of running your model on S3? |
@Auroragan |
doesn't look correct, your model is not heavy. channel = 256 is not a problem. For our 8-bit face recognition model, the inference time is only 280ms. What is your configuration for cache size, cache line size? |
@Auroragan |
@PureHing Raw image input into face detection model will first be resized to a smaller image according to resize_scale and converted to int16_t in the meantime. You can take this API for reference. |
@yehangyang |
model input shape = raw image shape * resize_scale. In the example here, the resize_scale is 0.2. You can run this example compare with its latency. |
@yehangyang There is no problem with the example.
Is it because your input is relatively small? free element:
Is it right? |
@PureHing , yes it is. Then I think the large latency is because your model has large calculations. Convolution has larger calculations than Depthwise Convolution under a similar configuration anyway. |
|
is it 3*3 convolution? Let me test it on the work day. |
yeah |
@yehangyang Hi,I'm sorry to bother you,Have you tested it? |
@PureHing Sorry, I'm on leave today. I'll test it tomorrow. |
@PureHing I've tested the model you provided before, the inference time is similar to your result, I guess you need to redesign the model structure if you want a faster model. |
@Auroragan Thanks |
I guess, the size of tensors from the first few layers are like 400-800 kB, it's pretty large |
@Auroragan I calculated that the first few layers of the model are only about 300-400ms. It consumes more than 2,000 ms since the conv2d_7 layer in the model. |
they are not conflict. ok it's like this: basically, if you want to be faster, i think both need to be optimized. |
ok, thanks much |
@Auroragan
Hi,
1.my onnx model input size is bx240x320x3,calib_dataset shape is (36,240,320,3)
log
What's the problem?
2.Which is more friendly to esp, dw or conv2d?
The text was updated successfully, but these errors were encountered: