You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TNN convert & Android inference Error: can't infer resource shape from binary param in benchmark mode, random generator may not be exactly same with the real resource. Segmentation fault.
#1949
Open
Gabriel819 opened this issue
Aug 2, 2023
· 3 comments
I'm trying to convert a model I made myself to tnn file.
I converted my model to onnx to tnn using convert.py on TNN/tools/convert2tnn and the result is <model_name>.opt.tnnproto, not <model_name>.tnnproto. What is the meaning of the opt here?
I got 'onnx to tnn convert success' message but is there something wrong?
And after putting this tnn model in benchmark/benchmark-model, I tried running benchmark/benchmark_android/benchmark_models.sh, and I got an error.
2023-08-02 20:27:30 968: E source/tnn/optimizer/graph_matcher/ir.cc:230 Found unknown blob [backbone.blocks.0.norm1.weight] at Node [/backbone/blocks.0/norm1/Add_1] E/tnn: virtual tnn::Status tnn::optimizer::NetOptimizerConvertMatMulToConv::Optimize(tnn::NetStructure *, tnn::NetResource *) [File source/tnn/optimizer/net_optimizer_convert_matmul_to_conv.cc][Line 77] code: 0x1000 msg: source/tnn/optimizer/graph_matcher/ir.cc:230 Found unknown blob [backbone.blocks.0.norm1.weight] at Node [/backbone/blocks.0/norm1/Add_1]E/tnn: virtual tnn::Status tnn::BinaryLayerResourceGenerator::GenLayerResource(tnn::LayerParam *, tnn::LayerResource **, std::vector<Blob *> &) [File source/tnn/interpreter/layer_resource_generator.cc][Line 399] [WARNNING] can't infer resource shape from binary param in benchmark mode, random generator may not be exactly same with the real resource! E/tnn: virtual tnn::Status tnn::BinaryLayerResourceGenerator::GenLayerResource(tnn::LayerParam *, tnn::LayerResource **, std::vector<Blob *> &) [File source/tnn/interpreter/layer_resource_generator.cc][Line 399] [WARNNING] can't infer resource shape from binary param in benchmark mode, random generator may not be exactly same with the real resource! E/tnn: virtual tnn::Status tnn::MatMulLayerResourceGenerator::GenLayerResource(tnn::LayerParam *, tnn::LayerResource **, std::vector<Blob *> &) [File source/tnn/interpreter/layer_resource_generator.cc][Line 544] [WARNNING] can't infer resource shape from MatMul param in benchmark mode, random generator may not be exactly same with the real resource! E/tnn: virtual tnn::Status tnn::BinaryLayerResourceGenerator::GenLayerResource(tnn::LayerParam *, tnn::LayerResource **, std::vector<Blob *> &) [File source/tnn/interpreter/layer_resource_generator.cc][Line 399] [WARNNING] can't infer resource shape from binary param in benchmark mode, random generator may not be exactly same with the real resource! Segmentation fault E/tnn: tnn::Status tnn::OpenCLRuntime::Init() [File source/tnn/device/opencl/opencl_runtime.cc][Line 205] load program cache skipped, ret: 40966, msg: code: 0xA006 msg: open program cache file failed, input path: /data/local/tmp//d1_tnn_ocl_fd8c6f613ff9c0d503dbc462bf21353f_66e6f26f5f12a3349f451b682262ebbb_arm E/tnn: virtual tnn::Status tnn::BinaryLayerResourceGenerator::GenLayerResource(tnn::LayerParam *, tnn::LayerResource **, std::vector<Blob *> &) [File source/tnn/interpreter/layer_resource_generator.cc][Line 399] [WARNNING] can't infer resource shape from binary param in benchmark mode, random generator may not be exactly same with the real resource! E/tnn: virtual tnn::Status tnn::BinaryLayerResourceGenerator::GenLayerResource(tnn::LayerParam *, tnn::LayerResource **, std::vector<Blob *> &) [File source/tnn/interpreter/layer_resource_generator.cc][Line 399] [WARNNING] can't infer resource shape from binary param in benchmark mode, random generator may not be exactly same with the real resource! E/tnn: virtual tnn::Status tnn::MatMulLayerResourceGenerator::GenLayerResource(tnn::LayerParam *, tnn::LayerResource **, std::vector<Blob *> &) [File source/tnn/interpreter/layer_resource_generator.cc][Line 544] [WARNNING] can't infer resource shape from MatMul param in benchmark mode, random generator may not be exactly same with the real resource! E/tnn: virtual tnn::Status tnn::BinaryLayerResourceGenerator::GenLayerResource(tnn::LayerParam *, tnn::LayerResource **, std::vector<Blob *> &) [File source/tnn/interpreter/layer_resource_generator.cc][Line 399] [WARNNING] can't infer resource shape from binary param in benchmark mode, random generator may not be exactly same with the real resource! Segmentation fault
This error keeps saying '[WARNNING] can't infer resource shape from binary param in benchmark mode, random generator may not be exactly same with the real resource!'.
The Error report has no clue which part of the model is wrong. What should be done to solve this problem?
The text was updated successfully, but these errors were encountered:
1. 环境(environment)
I'm trying to convert a model I made myself to tnn file.
I converted my model to onnx to tnn using convert.py on TNN/tools/convert2tnn and the result is <model_name>.opt.tnnproto, not <model_name>.tnnproto. What is the meaning of the opt here?
I got 'onnx to tnn convert success' message but is there something wrong?
And after putting this tnn model in benchmark/benchmark-model, I tried running benchmark/benchmark_android/benchmark_models.sh, and I got an error.
2023-08-02 20:27:30 968: E source/tnn/optimizer/graph_matcher/ir.cc:230 Found unknown blob [backbone.blocks.0.norm1.weight] at Node [/backbone/blocks.0/norm1/Add_1] E/tnn: virtual tnn::Status tnn::optimizer::NetOptimizerConvertMatMulToConv::Optimize(tnn::NetStructure *, tnn::NetResource *) [File source/tnn/optimizer/net_optimizer_convert_matmul_to_conv.cc][Line 77] code: 0x1000 msg: source/tnn/optimizer/graph_matcher/ir.cc:230 Found unknown blob [backbone.blocks.0.norm1.weight] at Node [/backbone/blocks.0/norm1/Add_1]E/tnn: virtual tnn::Status tnn::BinaryLayerResourceGenerator::GenLayerResource(tnn::LayerParam *, tnn::LayerResource **, std::vector<Blob *> &) [File source/tnn/interpreter/layer_resource_generator.cc][Line 399] [WARNNING] can't infer resource shape from binary param in benchmark mode, random generator may not be exactly same with the real resource! E/tnn: virtual tnn::Status tnn::BinaryLayerResourceGenerator::GenLayerResource(tnn::LayerParam *, tnn::LayerResource **, std::vector<Blob *> &) [File source/tnn/interpreter/layer_resource_generator.cc][Line 399] [WARNNING] can't infer resource shape from binary param in benchmark mode, random generator may not be exactly same with the real resource! E/tnn: virtual tnn::Status tnn::MatMulLayerResourceGenerator::GenLayerResource(tnn::LayerParam *, tnn::LayerResource **, std::vector<Blob *> &) [File source/tnn/interpreter/layer_resource_generator.cc][Line 544] [WARNNING] can't infer resource shape from MatMul param in benchmark mode, random generator may not be exactly same with the real resource! E/tnn: virtual tnn::Status tnn::BinaryLayerResourceGenerator::GenLayerResource(tnn::LayerParam *, tnn::LayerResource **, std::vector<Blob *> &) [File source/tnn/interpreter/layer_resource_generator.cc][Line 399] [WARNNING] can't infer resource shape from binary param in benchmark mode, random generator may not be exactly same with the real resource! Segmentation fault E/tnn: tnn::Status tnn::OpenCLRuntime::Init() [File source/tnn/device/opencl/opencl_runtime.cc][Line 205] load program cache skipped, ret: 40966, msg: code: 0xA006 msg: open program cache file failed, input path: /data/local/tmp//d1_tnn_ocl_fd8c6f613ff9c0d503dbc462bf21353f_66e6f26f5f12a3349f451b682262ebbb_arm E/tnn: virtual tnn::Status tnn::BinaryLayerResourceGenerator::GenLayerResource(tnn::LayerParam *, tnn::LayerResource **, std::vector<Blob *> &) [File source/tnn/interpreter/layer_resource_generator.cc][Line 399] [WARNNING] can't infer resource shape from binary param in benchmark mode, random generator may not be exactly same with the real resource! E/tnn: virtual tnn::Status tnn::BinaryLayerResourceGenerator::GenLayerResource(tnn::LayerParam *, tnn::LayerResource **, std::vector<Blob *> &) [File source/tnn/interpreter/layer_resource_generator.cc][Line 399] [WARNNING] can't infer resource shape from binary param in benchmark mode, random generator may not be exactly same with the real resource! E/tnn: virtual tnn::Status tnn::MatMulLayerResourceGenerator::GenLayerResource(tnn::LayerParam *, tnn::LayerResource **, std::vector<Blob *> &) [File source/tnn/interpreter/layer_resource_generator.cc][Line 544] [WARNNING] can't infer resource shape from MatMul param in benchmark mode, random generator may not be exactly same with the real resource! E/tnn: virtual tnn::Status tnn::BinaryLayerResourceGenerator::GenLayerResource(tnn::LayerParam *, tnn::LayerResource **, std::vector<Blob *> &) [File source/tnn/interpreter/layer_resource_generator.cc][Line 399] [WARNNING] can't infer resource shape from binary param in benchmark mode, random generator may not be exactly same with the real resource! Segmentation fault
This error keeps saying '[WARNNING] can't infer resource shape from binary param in benchmark mode, random generator may not be exactly same with the real resource!'.
The Error report has no clue which part of the model is wrong. What should be done to solve this problem?
The text was updated successfully, but these errors were encountered: