No relevant resource is found in the selected language.
This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>
Your browser version is too early. Some functions of the website may be unavailable. To obtain better user experience, upgrade the browser to the latest version.
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document.
Note: Even the most advanced machine translation cannot match the quality of professional translators.
Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
Model Loading
Model Loading
Figure 4-3 Model loading process
Before model loading, convert the third-party network (for example, Caffe ResNet-50) into an offline model (.om file) that adapts to Ascend AI Processors with the ATC. For details, see ATC Tool Instructions.
In fixed-batch scenarios with batchSize >1, set batchSize in the input_shape parameter during model conversion.
In dynamic batch size scenarios, set the batchSize choices in the dynamic_batch_size parameter during model conversion.
In dynamic image size scenarios, set the dynamic_image_size choices for model conversion.
In dynamic AIPP scenarios, set aipp_mode to dynamic in the configuration file of the insert_op_conf parameter during model conversion.
A model can be loaded by calling the following APIs. A model ID is returned after the model is successfully loaded.
acl.mdl.load_from_file: loads offline model data from a file. The memory is managed by the system.
acl.mdl.load_from_mem: loads offline model data from the memory. The memory is managed by the system.
acl.mdl.load_from_file_with_mem: loads offline model data from a file. The memory (including working memory for storing input and output data of the model, and weight memory for storing weight data) is managed by the user.
acl.mdl.load_from_mem_with_mem: loads offline model data from the memory. The memory (including working memory and weight memory) is managed by the user.