|
本帖最后由 nicolausYes 于 2020-7-22 05:17 编辑
I experience errors while converting tflite models to rknn using RKNN-Toolkit 1.3.2.
While converting tflite 1.14 model:
--> Loading model
E Catch exception when loading tflite model: ./supercombo_1.14.tflite!
E Traceback (most recent call last):
E File "rknn/api/rknn_base.py", line 396, in rknn.api.rknn_base.RKNNBase.load_tflite
E File "rknn/base/RKNNlib/converter/tflite_loader.py", line 75, in rknn.base.RKNNlib.converter.tflite_loader.TFLiteLoader.load
E File "rknn/base/RKNNlib/converter/tflite_loader.py", line 396, in rknn.base.RKNNlib.converter.tflite_loader.ModelParser.parse
E File "rknn/base/RKNNlib/converter/tflite_loader.py", line 342, in rknn.base.RKNNlib.converter.tflite_loader.ModelParser._build_layers
E File "rknn/base/RKNNlib/converter/tflite_loader.py", line 238, in rknn.base.RKNNlib.converter.tflite_loader.ModelParser._get_layer_RKNN_op
E File "rknn/base/RKNNlib/converter/lite/RKNN_map_op.py", line 510, in rknn.base.RKNNlib.converter.lite.RKNN_map_op.RKNNMapOp.map_RKNN_ops
E File "rknn/base/RKNNlib/converter/lite/RKNN_map_op.py", line 275, in rknn.base.RKNNlib.converter.lite.RKNN_map_op._permute
E File "rknn/base/RKNNlib/converter/lite/utils.py", line 180, in rknn.base.RKNNlib.converter.lite.utils.get_builtin_options
E File "rknn/base/RKNNlib/converter/lite/utils.py", line 174, in rknn.base.RKNNlib.converter.lite.utils.get_builtin_options_type
E AttributeError: module 'RKNNlib.converter.lite.tflite' has no attribute 'TransposeOptions'
Load failed!
While converting tflite 2.1 model:
--> Loading model E Catch exception when loading tflite model: ./supercombo_2.1.tflite! E Traceback (most recent call last): E File "rknn/api/rknn_base.py", line 396, in rknn.api.rknn_base.RKNNBase.load_tflite E File "rknn/base/RKNNlib/converter/tflite_loader.py", line 75, in rknn.base.RKNNlib.converter.tflite_loader.TFLiteLoader.load E File "rknn/base/RKNNlib/converter/tflite_loader.py", line 396, in rknn.base.RKNNlib.converter.tflite_loader.ModelParser.parse E File "rknn/base/RKNNlib/converter/tflite_loader.py", line 342, in rknn.base.RKNNlib.converter.tflite_loader.ModelParser._build_layers E File "rknn/base/RKNNlib/converter/tflite_loader.py", line 238, in rknn.base.RKNNlib.converter.tflite_loader.ModelParser._get_layer_RKNN_op E File "rknn/base/RKNNlib/converter/lite/RKNN_map_op.py", line 510, in rknn.base.RKNNlib.converter.lite.RKNN_map_op.RKNNMapOp.map_RKNN_ops E File "rknn/base/RKNNlib/converter/lite/RKNN_map_op.py", line 276, in rknn.base.RKNNlib.converter.lite.RKNN_map_op._permute E AttributeError: 'NoneType' object has no attribute 'PermAsNumpy' Load failed!
I can't use lower version than 1.14, because ELU operation was introduced in tensorflow 1.14.
Attachment includes:
supercombo.keras-original model.
supercombo_1.14.tflite – tflite model converted with tensorflow 1.14.
supercombo_2.1.tflite – tflite model converted with tensorflow 2.1.
convert2.py – python script to convert tflite to rknn.
https://1drv.ms/u/s!Ai_yk0dieAUPgytiDDqvlv4hwS4b?e=TXUl1V
|
|