All questions related to Real-Time Image Super-Resolution Challenge can be asked in this thread.
Or is there a minimum performance requirement or a maximum time limit?
What is the basis for the final ranking?
What is the ratio of performance to running time?
Hello, I am confused the dimension of AI Benchmark input since the input shape is dynamic.
360 x 640 px
, we will send the exact instructions soon when we open the runtime validation submission.does the AI Benchmark support tf.space_to_depth layer?
It seems like Upsampling2D layer is not supported
Upsampling2D
layer is supported, please follow this tutorial for more details (especially check the information about the experimental_new_converter
flag). If the problem is still there - please start a new thread here.Thanks I have tried it with experimental_new_converter off and it works at least with my setup (samsung phone, ubuntu, tensorflow 2.3)Upsampling2D
layer is supported, please follow this tutorial for more details (especially check the information about theexperimental_new_converter
flag). If the problem is still there - please start a new thread here.
it even takes half an hour for each picture.
will there be a remote platform that can evaluate our model runtime on the target device?
Is this "0.2s" ran on CPU with XNNPACK option on or not?
Why is the input size required in tf lite (360x640), but the submitted result requires the original size?Traceback (most recent call last):
File "/tmp/codalab/tmpSCpd0D/run/program/evaluation.py", line 95, in
raise Exception('Expected %d .png images'%len(ref_pngs))
Exception: Expected 100 .png images
First of all to process all of the validation images which are different in size the model should be trained with size (None,None,3)
So that 0.2 is very much device dependent. So there should be another way of measure how performant out model can be.
Here I attach the tflite file model_no_quant.tflite works model_quant.tflite fails with app crash
depth_to_space
op works only with the latest nightly TFLite build. The corresponding AI Benchmark version will be published here on the 10th of March, the provided model runs fine with it. We are also trying to provide you with beta access to this build via the Google Play now.Why is the input size required in tf lite (360x640), but the submitted result requires the original size?
360 x 640
pixels.Is it ok for us to not test those images when we submit the sr images package?
Can you give me some advice?
What is the version of tensorflow that supports quantize ‘depth to space‘?
depth_to_space
op should be running fine.Which op is not optimized in your NPU accelerator?
How long would it take for the element-wise op (add) if the op not optimized?
--Tensorflow-gpu version: [2.2.0]
Conversion: [tf.lite.TFLiteConverter.from_concrete_functions]
It seems that "tf.nn.depth_to_space" layer cannot be used with quantization-aware training. The same thing happens with "tf.concat" layer.{'name': 'tf.nn.depth_to_space', 'inbound_nodes': [['conv2d', 0, 0, {'block_size': 3}]]}
Hi richlaji first of all great to see your challenging timing scores well done and good luck!Hi,
I try to use quantization-aware training and failed. The error is "TypeError: tf__call() got an unexpected keyword argument 'block_size'".
I print the layer of my model and find that the depth_to_space layer has a parameter 'block_size'
It seems that "tf.nn.depth_to_space" layer cannot be used with quantization-aware training. The same thing happens with "tf.concat" layer.
Can you give me some advise? Thank you~
-- tf version: tf-nightly 2.5.0.dev20210310
Thank you for your sharing~Hi richlaji first of all great to see your challenging timing scores well done and good luck!
I can help you with that, try to wrap tf.nn.depth_to_space with Lambda layer since tf.nn is tensorflow operator, but Lambda encapsulates it as a keras layer. Same applies for "+" operator it is a tensorflow operator but Add()(...) is a keras layer so don't mix keras layers with tf operators.
Best.
Do you train successfully by passing a `tfmot.quantization.keras.QuantizeConfig` instance to the `quantize_annotate_layer`?"Layer lambda:<class 'tensorflow.python.keras.layers.core.Lambda'> is not supported." You can quantize this layer by passing a `tfmot.quantization.keras.QuantizeConfig` instance to the `quantize_annotate_layer` API
Hi,Hello, my model can run normally in AI benchmark FP16 and FP32, but it fails in INT8. The error message is:
‘java.lang.illegalArgumentException:Cannot copy to a TensorFlowLite tensor (serving_default_input:0) with 2764800 bytes from a Java Buffer with 691200 bytes ’
What's the reason for this?
Yes I could do thatThank you for your sharing~
I try to use Lambda layer and get another error.(same to tf.concat).
Do you train successfully by passing a `tfmot.quantization.keras.QuantizeConfig` instance to the `quantize_annotate_layer`?
Thank you very much!!!Yes I could do that
from tensorflow_model_optimization.python.core.quantization.keras.default_8bit import default_8bit_quantize_configs
import tensorflow_model_optimization as tfmot
self.Depth2Space = kl.Lambda(lambda x: tf.nn.depth_to_space(x, 3))
x = tfmot.quantization.keras.quantize_annotate_layer(self.Depth2Space, quantize_config=default_8bit_quantize_configs.NoOpQuantizeConfig())(x)
Hi, thank you for your advise and I can use quantization-aware training now~ I trained a small model with quantization-aware training now.Yes I could do that
from tensorflow_model_optimization.python.core.quantization.keras.default_8bit import default_8bit_quantize_configs
import tensorflow_model_optimization as tfmot
self.Depth2Space = kl.Lambda(lambda x: tf.nn.depth_to_space(x, 3))
x = tfmot.quantization.keras.quantize_annotate_layer(self.Depth2Space, quantize_config=default_8bit_quantize_configs.NoOpQuantizeConfig())(x)
As far as I know int8 conversion could result in slight decrease in accuracy so I think it is reasonableHi, thank you for your advise and I can use quantization-aware training now~ I trained a small model with quantization-aware training now.
(1) inference with tf model, the psnr is 29.33892
(2) inference with tflite int8, the psnr is 29.24394
I want to know is it reasonable. Thank you again~
The quantized model without the following two lines loses small psnr, but if I uncomment them, psnr decreases from 29dB to 20dB. I want to know whether it is normal?
I want to know is it reasonable. Thank you again~
while using tflite in PC the model is not using the GPU and falling back to CPU since the tflite interpreter is not optimized for Nvidia GPUs but for mobile GPUs but still 779s is a lot. it seems like your model is kind of "huge" for the challenge, Try a very simple model convert it to tflite and check it again.I use my model in AI Benchmark the app is crash. And it run in test_tflite succesfully ,but per image run-time is 779s. I dont know why,I think may be the reason is size. I use keras-to-tflite to quantilize, when I was training model I write x=Input(None,None,3), when I was quantify I change the code to x= Input(360,640,3).Is it right operating?Or I use keras-to-tflite but actually the code is mix tf.nn.layer and tf.keras .Fuck tflite
Thanks u so much .I try the model with the beta.But now it tell me the following, do you know why?while using tflite in PC the model is not using the GPU and falling back to CPU since the tflite interpreter is not optimized for Nvidia GPUs but for mobile GPUs but still 779s is a lot. it seems like your model is kind of "huge" for the challenge, Try a very simple model convert it to tflite and check it again.
Regarding to app crash Andrey knows better but at least with the regular AI-Benchmark app from the store "depth_to_space" is not supported. You should join the beta program first and get the beta version of the app. If this layer is not the case it is another issue and Andrey might give you better explanation on this.
make sure your have model.tflite in Downloads folder it seems like it could not find the fileView attachment 14What can I do
Maybe there are parallel cores which can infer in parallel and the general inference is bounded by the resize branch?Hi, I think there is something wrong with the inference Time of my models.
The model in my submition '0311_submition_01.zip' should contains only a ResizeNearestNeighbor layer/
The model in my submition '0311_submition_02.zip' contains a lot of layers(e.g. conv, resize)
But they have the same inference time. Could you please help me check out what's going on?(May be this is still the runtime of the old model?Is there some requirements for naming the tflite models)
Thanks!
View attachment 13