Hi,
I'm having issues compiling my model with PReLU activation for iMX8MP. This operation is supposed to be supported.
I'm converting and quantizing (to int8) the model from keras to tflite using quantization aware training with native tflite methods
k_model = keras.models.load_model(path_keras)
print("Converting Keras model to int8 tflite format")
converter = tf.lite.TFLiteConverter.from_keras_model(k_model)
converter.target_spec.supported_ops = [
tf.lite.OpsSet.TFLITE_BUILTINS,
tf.lite.OpsSet.TFLITE_BUILTINS_INT8,
]
converter.optimizations = [tf.lite.Optimize.DEFAULT]
converter.representative_dataset = tf.lite.RepresentativeDataset(
ImageDataset(shuffle=True, limit=200, channel_first=False, input_name="input_1").generator
)
converter.target_spec.supported_ops = [tf.lite.OpsSet.TFLITE_BUILTINS_INT8]
converter.inference_input_type = tf.int8
converter.inference_output_type = tf.int8
tflite_model = converter.convert()
with open(path_tflite, "wb") as f:
f.write(tflite_model)
This is the error:
Vx delegate: allowed_cache_mode set to 0.
Vx delegate: device num set to 0.
Vx delegate: allowed_builtin_code set to 0.
Vx delegate: error_during_init set to 0.
Vx delegate: error_during_prepare set to 0.
Vx delegate: error_during_invoke set to 0.
input: serving_default_input_1:0shape: [ 1 112 112 3] dtype: <class 'numpy.int8'>
W [HandleLayoutInfer:274]Op 162: default layout inference pass.
(267:0) : error : Error(0,267) : Cannot find the header file cl_viv_vx_ext.h.
(25:0) : error : undefined identifier: 'COPY'
(59:0) : error : undefined identifier: 'COPY'
(270:0) : error : syntax error at 'VXC_512Bits'
ERROR: Failed to compile vx shader. (error: FFFFFFFF)
E [kernel/vsi_nn_kernel.c:_gpu_register:600]Build program fail.
E [kernel/vsi_nn_kernel.c:vsi_nn_kernel_create_node:874]Register client kernel com.vivantecorp.extension.evis.prelu_U8U8toU8_2D fail with -1.
(267:0) : error : Error(0,267) : Cannot find the header file cl_viv_vx_ext.h.
(25:0) : error : undefined identifier: 'COPY'
(59:0) : error : undefined identifier: 'COPY'
(270:0) : error : syntax error at 'VXC_512Bits'
This is repeated for 49 times and then this last error is shown:
ERROR: Failed to compile vx shader. (error: FFFFFFFF)
E [kernel/vsi_nn_kernel.c:_gpu_register:600]Build program fail.
E [kernel/vsi_nn_kernel.c:vsi_nn_kernel_create_node:874]Register client kernel com.vivantecorp.extension.evis.prelu_U8U8toU8_2D fail with -1.
Do you identify this error? PReLU is supposed to work, why am I seeing this error?
Thanks in advance