Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
On this page
Help Center/ ModelArts/ SDK Reference/ Model Management/ Obtaining Details About a Model

Obtaining Details About a Model

Updated on 2024-03-21 GMT+08:00

You can use the API to obtain the information about a model object.

Sample Code

In ModelArts notebook, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development environments, see Session Authentication.

  • Method 1: Obtain details about a model based on the model object created in Importing a Model.
    1
    2
    3
    4
    5
    6
    7
    from modelarts.session import Session
    from modelarts.model import Model
    
    session = Session()
    model_instance = Model(session, model_id="your_model_id")
    model_info = model_instance.get_model_info()
    print(model_info)
    
  • Method 2: Obtain details about a model based on the model object returned in Obtaining Model Objects.
    1
    2
    3
    4
    5
    6
    7
    8
    from modelarts.session import Session
    from modelarts.model import Model
    
    session = Session()
    model_object_list = Model.get_model_object_list(session)
    model_instance = model_object_list[0]                
    model_info = model_instance.get_model_info()
    print(model_info)
    

Parameters

Table 1 get_model_info response parameters

Parameter

Type

Description

model_id

String

Model ID

model_name

String

Model name

model_version

String

Model version

tenant

String

Tenant

project

String

Project

owner

String

User

create_at

Long

Time when a model is created, in milliseconds calculated from 1970.1.1 0:0:0 UTC

source_location

String

OBS path where a model resides

source_job_id

String

ID of the source training job

source_job_version

String

Version of the source training job

source_type

String

Type of a model source

  • If a model is deployed by an ExeML project, the value is auto.
  • If a model is deployed by a training job or OBS model file, this parameter is left blank.

model_type

String

Model type. The value can be TensorFlow, MXNet, Spark_MLlib, Scikit_Learn, XGBoost, MindSpore, Image, or PyTorch.

model_size

Long

Model size, in bytes

model_status

String

Model status. The value can be publishing, published, or failed.

description

String

Model description

execution_code

String

OBS path for storing the execution code. The name of the execution code file is fixed to customize_service.py.

schema_doc

String

Download address of the model schema file

image_address

String

Execution image path of a model. Before the image is built, that is, before a model has been published as a service, this parameter is left blank.

input_params

params array

Collection of input parameters of a model. By default, this parameter is left blank.

output_params

params array

Collection of output parameters of a model. By default, this parameter is left blank.

dependencies

dependency array

Package required for running the code and model

model_metrics

String

Model evaluation parameter. This parameter is returned only when source_job_id and source_job_version are assigned values and the corresponding training job has evaluation results.

apis

String

All apis input and output parameters of the model

Table 2 params parameters

Parameter

Type

Description

url

String

API URL

param_name

String

Parameter name, which contains a maximum of 64 characters

param_type

String

Parameter type. The value can be int, string, float, timestamp, date, or file.

min

Number

When param_type is set to int or float and min is set during model creation, the value will be returned. By default, this parameter is left blank.

max

Number

When param_type is set to int or float and max is set during model creation, the value will be returned. By default, this parameter is left blank.

param_desc

String

Parameter description, which contains a maximum of 100 characters. By default, this parameter is left blank.

Table 3 dependency parameters

Parameter

Type

Description

installer

String

Installer

packages

package array

Collection of dependency packages

Table 4 package parameters

Parameter

Type

Description

package_name

String

Name of a dependency package

package_version

String

Version of a dependency package

restraint

String

Version filtering criterion. The options are as follows:

  • EXACT: the specified version
  • ATLEAST: not earlier than the specified version
  • ATMOST: not later than the specified version
Table 5 metric parameters

Parameter

Mandatory

Type

Description

f1

Yes

Double

Mean

recall

Yes

Double

Recall

precision

Yes

Double

Precision

accuracy

Yes

Double

Accuracy

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback