Got it

Last Attempt: Conversion from HuaweiCloud Yolov3_resnet18 output to Atlas 200 DK

Created: May 22, 2021 17:38:46Latest reply: May 24, 2021 10:49:12 510 8 1 0 0
  HiCoins as reward: 0 (problem unresolved)

Dear all,


This is my last attempt to convert the frozen_graph output from AI Gallery at HuaweiCloud. Please help me to keep my trust to use Huawei products that can run and applied to Atlas 200 DK.

Object detection YOLOv3_ResNet18
ResNet18 is the backbone, supporting CPU, GPU, Ascend310 inference

https://marketplace.huaweicloud.com/markets/aihub/modelhub/detail/?id=948196c8-3e7a-4729-850b-069101d6e95c

t

What is the meaning of "output framework = MindSpore"?

What is the meaning of Ascend-C32?

How do we change into Altas 200 DK format?


From insert_op_conf.cfg file. I notice that input format is RGB888_U8 --> Intput Type = UINT8.

aipp_op { 

related_input_rank : 0

src_image_size_w : 640

src_image_size_h : 352

crop : false

padding : false

aipp_mode: static

input_format : RGB888_U8

csc_switch : false

rbuv_swap_switch : false

mean_chn_0 : 104

mean_chn_1 : 117

mean_chn_2 : 123

min_chn_0 : 0.0

min_chn_1 : 0.0

min_chn_2 : 0.0

var_reci_chn_0 : 0.003922

var_reci_chn_1 : 0.003922

var_reci_chn_2 : 0.003922

}

1


So I change the Model Image Format = RGB.

I put var_reci_chn_0 : 0.003922

I still use Conversion Type value (The value are for model image format = YUV420sp)

2


I put additional arguments:

--output_type=FP32 

--save_original_model=false 

--insert_op_conf="/home/suryadi/models/yolov3_resnet18/frozen_graph/insert_op_conf.cfg" 

--log=info 

--input_fp16_nodes="" 

3


The ATC can run successfully. 

atc


BUT, it is failed when I run the ../model/yolo3_resnet18.om? 

v5

I already use the latest CANN 3.3.0 at my native ubuntu 18.04. I use 3.3.0-alpha001 at Atlas 200 DK using 256 GB SDcard from http://c7xcode.obs.cn-north-4.myhuaweicloud.com/sdimg/3.3.0alpha001-catenation-32G-20210416.zip


Is there any explanation? How to rectify this problem? 

Please help. Thank you very much in advance.


Warmest Regards,

Suryadi


PS: I try to attach ModelConvert.txt (log file), but the forum did not upload it well.

xx


Featured Answers

Recommended answer

yaoyu1230
Created May 24, 2021 07:35:58

"What is the meaning of "output framework = MindSpore"?
What is the meaning of Ascend-C32?
How do we change into Altas 200 DK format?"
This is a configuration for deployment on the Hilens platform. If you want to perform model inference on our 200dk, what you did is correct, that is, convert to an om model and then infer.


The reasoning error is because your model requires the input format to be RGB, and the input image format you use to send the model to the model is yuv420sp, so an error is reported. 

1

You can refer to the mask recognition example. The preprocessing part of this model is to convert the image to RGB format is now available and can be sent directly to the model for reasoning:https://gitee.com/ascend/samples/tree/master/python/level2_simple_inference/2_object_detection/YOLOV3_mask_detection_picture


View more
  • x
  • convention:

All Answers
Hello,

Please kindly wait for a minute.

Our engineer is dealing with your question.
View more
  • x
  • convention:

Hi, Suryadi,

When you already have AIPP configuration file, you can turn off "Data Preprocessing" in the second page of Model Converter, and add Additional Arguments "insert_op_conf" in the third page.

Good luck.

Pengcheng

View more
  • x
  • convention:

Hi, Suryadi,

When the application failed to run, you can find more information about the error by analysing the log in the "~/ascend/log/".

I hope this can help you.

View more
  • x
  • convention:

delete

View more
  • x
  • convention:

Posted by Pengcheng at 2021-05-24 02:31Hi, Suryadi,When the application failed to run, you can find more information about the error by ana ...

This is the ~/ascend/log/plog/plog-2345_20210524064140365.log

[EVENT] PROFILING(2345,main):2021-05-24-06:41:40.311.602 [msprof_callback_handler.cpp:144] >>> (tid:2345) Started to register profiling callbacks to acl
[INFO] ASCENDCL(2345,main):2021-05-24-06:41:40.311.634 [acl_prof_api.cpp:64]2345 _aclprofRegisterCtrlCallback: start to register ctrl callback
[INFO] ASCENDCL(2345,main):2021-05-24-06:41:40.311.646 [acl_prof_api.cpp:75]2345 _aclprofRegisterCtrlCallback: successfully register ctrl callback
[INFO] ASCENDCL(2345,main):2021-05-24-06:41:40.768.156 [acl.cpp:43]2345 aclInit: start to execute aclInit
[INFO] ASCENDCL(2345,main):2021-05-24-06:41:40.768.473 [acl.cpp:56]2345 aclInit: set DumpConfig in aclInit
[INFO] ASCENDCL(2345,main):2021-05-24-06:41:40.768.488 [dump.cpp:363]2345 HandleDumpConfig: start to execute HandleDumpConfig
[INFO] ASCENDCL(2345,main):2021-05-24-06:41:40.768.520 [json_parser.cpp:176]2345 ParseJsonFromFile: before ParseJsonFromFile in ParseJsonFromFile
[INFO] ASCENDCL(2345,main):2021-05-24-06:41:40.768.853 [json_parser.cpp:139]2345 ParseJson: json file's obj's depth is 1, array's depth is 0
[INFO] ASCENDCL(2345,main):2021-05-24-06:41:40.768.916 [json_parser.cpp:210]2345 ParseJsonFromFile: parse json from file[../src/acl.json] successfully.
[INFO] ASCENDCL(2345,main):2021-05-24-06:41:40.768.929 [dump.cpp:381]2345 HandleDumpConfig: no dump item, no need to do dump!
[INFO] ASCENDCL(2345,main):2021-05-24-06:41:40.768.937 [dump.cpp:387]2345 HandleDumpConfig: HandleDumpConfig end in HandleDumpConfig
[INFO] ASCENDCL(2345,main):2021-05-24-06:41:40.768.947 [acl.cpp:62]2345 aclInit: set HandleDumpConfig success in aclInit
[INFO] ASCENDCL(2345,main):2021-05-24-06:41:40.768.954 [acl.cpp:64]2345 aclInit: set max_opqueue_num in aclInit
[INFO] ASCENDCL(2345,main):2021-05-24-06:41:40.768.965 [op_model_manager.cpp:36]2345 HandleMaxOpQueueConfig: start to execute HandleMaxOpQueueConfig
[INFO] ASCENDCL(2345,main):2021-05-24-06:41:40.768.974 [json_parser.cpp:176]2345 ParseJsonFromFile: before ParseJsonFromFile in ParseJsonFromFile
[INFO] ASCENDCL(2345,main):2021-05-24-06:41:40.769.051 [json_parser.cpp:139]2345 ParseJson: json file's obj's depth is 1, array's depth is 0
[INFO] ASCENDCL(2345,main):2021-05-24-06:41:40.769.075 [json_parser.cpp:210]2345 ParseJsonFromFile: parse json from file[../src/acl.json] successfully.
[INFO] ASCENDCL(2345,main):2021-05-24-06:41:40.769.085 [op_model_manager.cpp:62]2345 HandleMaxOpQueueConfig: no max_opqueue_num found, set default DEFAULT_MAX_OPQUEUE_NUM[10000].
[INFO] ASCENDCL(2345,main):2021-05-24-06:41:40.769.094 [op_model_manager.cpp:68]2345 HandleMaxOpQueueConfig: HandleMaxOpQueueConfig end in HandleMaxOpQueueConfig
[INFO] ASCENDCL(2345,main):2021-05-24-06:41:40.769.102 [acl.cpp:70]2345 aclInit: set HandleMaxOpQueueConfig success in aclInit
[INFO] ASCENDCL(2345,main):2021-05-24-06:41:40.769.110 [acl.cpp:73]2345 aclInit: set ProfilingConfig in aclInit
[INFO] ASCENDCL(2345,main):2021-05-24-06:41:40.769.118 [profiling.cpp:61]2345 HandleProfilingConfig: start to execute HandleProfilingConfig
[INFO] ASCENDCL(2345,main):2021-05-24-06:41:40.769.128 [profiling.cpp:55]2345 GetProfilingConfigFile: no profiling config file.
[INFO] ASCENDCL(2345,main):2021-05-24-06:41:40.769.145 [json_parser.cpp:176]2345 ParseJsonFromFile: before ParseJsonFromFile in ParseJsonFromFile
[INFO] ASCENDCL(2345,main):2021-05-24-06:41:40.769.214 [json_parser.cpp:139]2345 ParseJson: json file's obj's depth is 1, array's depth is 0
[WARNING] ASCENDCL(2345,main):2021-05-24-06:41:40.770.267 [json_parser.cpp:201]2345 ParseJsonFromFile: find key[profiler] in json file ../src/acl.json failed
[INFO] ASCENDCL(2345,main):2021-05-24-06:41:40.770.283 [profiling.cpp:82]2345 HandleProfilingConfig: parse profiling config from file[../src/acl.json] failed, result = 100000

[INFO] ASCENDCL(2345,main):2021-05-24-06:41:40.770.294 [acl.cpp:83]2345 aclInit: call ge interface executor.Initialize
[INFO] GE(2345,main):2021-05-24-06:41:40.770.304 [/home/jenkins/agent/workspace/Compile_GraphEngine_Centos_ARM/graphengine/ge/executor/ge_executor.cc:205]2345 Initialize:Init GeExecutor begin.
[INFO] GE(2345,main):2021-05-24-06:41:40.770.346 [/home/jenkins/agent/workspace/Compile_GraphEngine_Centos_ARM/graphengine/ge/graph/manager/graph_mem_allocator.cc:170]2345 Initialize:Create MemoryAllocator memory type[2] success.
[INFO] GE(2345,main):2021-05-24-06:41:40.770.356 [/home/jenkins/agent/workspace/Compile_GraphEngine_Centos_ARM/graphengine/ge/graph/manager/graph_mem_allocator.cc:25]2345 Initialize:MemoryAllocator::Initialize
[INFO] GE(2345,main):2021-05-24-06:41:40.770.369 [/home/jenkins/agent/workspace/Compile_GraphEngine_Centos_ARM/graphengine/ge/graph/manager/graph_mem_allocator.cc:170]2345 Initialize:Create MemoryAllocator memory type[17] success.
[INFO] GE(2345,main):2021-05-24-06:41:40.770.377 [/home/jenkins/agent/workspace/Compile_GraphEngine_Centos_ARM/graphengine/ge/graph/manager/graph_mem_allocator.cc:25]2345 Initialize:MemoryAllocator::Initialize
[INFO] GE(2345,main):2021-05-24-06:41:40.770.397 [/home/jenkins/agent/workspace/Compile_GraphEngine_Centos_ARM/graphengine/ge/graph/manager/graph_mem_allocator.h:193]2345 InitAllocator:Create Allocator memory type[2] success.
[INFO] GE(2345,main):2021-05-24-06:41:40.770.406 [/home/jenkins/agent/workspace/Compile_GraphEngine_Centos_ARM/graphengine/ge/graph/manager/graph_caching_allocator.cc:104]2345 Initialize:Device id 0
[INFO] GE(2345,main):2021-05-24-06:41:40.770.415 [/home/jenkins/agent/workspace/Compile_GraphEngine_Centos_ARM/graphengine/ge/graph/manager/graph_caching_allocator.cc:348]2345 FreeBlocks:Free blocks
[INFO] GE(2345,main):2021-05-24-06:41:40.770.856 [/home/jenkins/agent/workspace/Compile_GraphEngine_Centos_ARM/graphengine/ge/graph/manager/graph_caching_allocator.cc:316]2345 FreeCachedBlocks:Free cached blocks
[INFO] GE(2345,main):2021-05-24-06:41:40.770.886 [/home/jenkins/agent/workspace/Compile_GraphEngine_Centos_ARM/graphengine/ge/graph/manager/graph_mem_allocator.h:193]2345 InitAllocator:Create Allocator memory type[17] success.
[INFO] GE(2345,main):2021-05-24-06:41:40.770.895 [/home/jenkins/agent/workspace/Compile_GraphEngine_Centos_ARM/graphengine/ge/graph/manager/graph_caching_allocator.cc:104]2345 Initialize:Device id 0
[INFO] GE(2345,main):2021-05-24-06:41:40.770.903 [/home/jenkins/agent/workspace/Compile_GraphEngine_Centos_ARM/graphengine/ge/graph/manager/graph_caching_allocator.cc:348]2345 FreeBlocks:Free blocks
[INFO] GE(2345,main):2021-05-24-06:41:40.770.910 [/home/jenkins/agent/workspace/Compile_GraphEngine_Centos_ARM/graphengine/ge/graph/manager/graph_caching_allocator.cc:316]2345 FreeCachedBlocks:Free cached blocks
[INFO] GE(2345,main):2021-05-24-06:41:40.770.932 [/home/jenkins/agent/workspace/Compile_GraphEngine_Centos_ARM/graphengine/ge/graph/manager/graph_mem_allocator.h:193]2345 InitAllocator:Create Allocator memory type[2] success.
[INFO] GE(2345,main):2021-05-24-06:41:40.770.944 [/home/jenkins/agent/workspace/Compile_GraphEngine_Centos_ARM/graphengine/ge/graph/manager/graph_mem_allocator.h:193]2345 InitAllocator:Create Allocator memory type[17] success.
[INFO] GE(2345,main):2021-05-24-06:41:40.770.962 [/home/jenkins/agent/workspace/Compile_GraphEngine_Centos_ARM/graphengine/ge/graph/manager/graph_mem_allocator.h:193]2345 InitAllocator:Create Allocator memory type[2] success.
[INFO] GE(2345,main):2021-05-24-06:41:40.770.975 [/home/jenkins/agent/workspace/Compile_GraphEngine_Centos_ARM/graphengine/ge/graph/manager/graph_mem_allocator.h:193]2345 InitAllocator:Create Allocator memory type[17] success.
[INFO] GE(2345,main):2021-05-24-06:41:40.770.992 [/home/jenkins/agent/workspace/Compile_GraphEngine_Centos_ARM/graphengine/ge/opskernel_manager/ops_kernel_builder_manager.cc:57]2345 Initialize:Number of OpBuild = 0
[INFO] GE(2345,main):2021-05-24-06:41:40.771.033 [/home/jenkins/agent/workspace/Compile_GraphEngine_Centos_ARM/graphengine/ge/common/profiling/profiling_manager.cc:81]2345 Init:ProfilingManager::Init  job_id:1
[INFO] GE(2345,main):2021-05-24-06:41:40.771.058 [/home/jenkins/agent/workspace/Compile_GraphEngine_Centos_ARM/graphengine/ge/common/profiling/profiling_manager.cc:105]2345 Init:The profiling is off, skip the initialization
[INFO] GE(2345,main):2021-05-24-06:41:40.771.066 [/home/jenkins/agent/workspace/Compile_GraphEngine_Centos_ARM/graphengine/ge/executor/ge_executor.cc:230]2345 Initialize:Init GeExecutor over.
[INFO] RUNTIME(2345,main):2021-05-24-06:41:40.777.173 [runtime.cc:796]2345 BootRuntime:new Runtime ok, Runtime_alloc_size 3200


a


What should we put inside this ../src/acl.json?

At least find key[profiler]  thing.

Thank you very much in advance.


Warmest Regards,

Suryadi

View more
  • x
  • convention:

Posted by sliawatimena at 2021-05-24 06:44 Posted by Pengcheng at 2021-05-24 06:44Hi, Suryadi,When the application failed to run, you can find m ...
This Error doesn't affect inference result. To avoid this error, you can create acl.json and put "{}" in it.
View more
  • x
  • convention:

"What is the meaning of "output framework = MindSpore"?
What is the meaning of Ascend-C32?
How do we change into Altas 200 DK format?"
This is a configuration for deployment on the Hilens platform. If you want to perform model inference on our 200dk, what you did is correct, that is, convert to an om model and then infer.


The reasoning error is because your model requires the input format to be RGB, and the input image format you use to send the model to the model is yuv420sp, so an error is reported. 

1

You can refer to the mask recognition example. The preprocessing part of this model is to convert the image to RGB format is now available and can be sent directly to the model for reasoning:https://gitee.com/ascend/samples/tree/master/python/level2_simple_inference/2_object_detection/YOLOV3_mask_detection_picture


View more
  • x
  • convention:

Posted by yaoyu1230 at 2021-05-24 07:35 "What is the meaning of "output framework = MindSpore"?What is the meaning of Ascend-C32?How do we c ...

Dear @yaoyu1230,

I think the original program can read JPEG (or RBG) file and recognize it as boat and dog.


I did not change the data input (dog.jpg and boat.jpg).
I only change the model from
const char* kModelPath = "../model/yolov3.om";
into
const char* kModelPath = "../model/yolo3_resnet18.om";


I found that line 203 is the error location.

rr


How to resolve this problem? I think the problem is at ATC stage and the model can not be executed by Atlas 200 DK.


When I put back using yolov3.om, and give my third image for testing called cakalang.jpg the model can recognize all of them. 

cc


But the model does not recognize my fish.

ccv

Thank you very much in advance.


Warmest Regards,

Suryadi

View more
  • x
  • convention:

Comment

You need to log in to comment to the post Login | Register

Notice: To protect the legitimate rights and interests of you, the community, and third parties, do not release content that may bring legal risks to all parties, including but are not limited to the following:
  • Politically sensitive content
  • Content concerning pornography, gambling, and drug abuse
  • Content that may disclose or infringe upon others ' commercial secrets, intellectual properties, including trade marks, copyrights, and patents, and personal privacy
Do not share your account and password with others. All operations performed using your account will be regarded as your own actions and all consequences arising therefrom will be borne by you. For details, see " User Agreement."

My Followers

Login and enjoy all the member benefits

Login

Block
Are you sure to block this user?
Users on your blacklist cannot comment on your post,cannot mention you, cannot send you private messages.
Reminder
Please bind your phone number to obtain invitation bonus.