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
Help Center/ ModelArts/ ModelArts User Guide (Standard)/ Model Training/ Creating a Debug Training Job/ Using PyCharm Toolkit to Create and Debug a Training Job

Using PyCharm Toolkit to Create and Debug a Training Job

Updated on 2024-12-26 GMT+08:00

AI developers use PyCharm to develop algorithms or models. ModelArts provides the PyCharm Toolkit plug-in to help AI developers quickly submit locally developed code to the ModelArts training environment. With PyCharm Toolkit, developers can quickly remotely access notebook instances through SSH, upload code, submit training jobs, and obtain training logs for local display so that they can better focus on local code development.

This section describes how to use PyCharm Toolkit to create and debug a training job.

Prerequisites

  • Step 1 Download and Install PyCharm Toolkit
  • A training code project exists in the local PyCharm.
  • You have created a bucket and folders in OBS for storing datasets and trained models. For example, create a bucket named test-modelarts2 and folders dataset-mnist and mnist-output. Data used by the training job has been uploaded to OBS. OBS and ModelArts are in the same region.

Configuring Training Job Parameters

  1. In PyCharm, open the training code project and training boot file, and choose ModelArts > Training Job > New... on the menu bar.
    Figure 1 Configuring job parameters
  2. In the displayed dialog box, configure the training job parameters. For details, see Table 1.
    Table 1 Training job parameters

    Parameter

    Description

    Job Name

    Name of the training job.

    The system automatically generates a name. You can rename it based on the following naming rules:

    • The name contains 1 to 64 characters.
    • Letters, digits, hyphens (-), and underscores (_) are allowed.

    Job Description

    Brief description of the training job.

    Algorithm Source

    Source of the training algorithm. The options are Frequently-used and Custom.

    Frequently-used refers to the frequently-used AI engines supported by ModelArts Training Management. For details about the supported engines, see Preset Images Supported by ModelArts.

    If the AI engine you use is not in the supported list, you are advised to create a training job using a custom image.

    AI Engine

    Select the AI engine and the version used in code. The supported AI engines are the same as Preset Images Supported by ModelArts on the ModelArts console.

    Boot File Path

    Training boot file. The selected boot file must be a file in the current PyCharm training project. This parameter is displayed if Algorithm source is set to Frequently-used.

    Code Directory

    Training code directory. The system automatically sets this parameter to the directory where the training boot file is located. You can change the parameter value to a directory that is in the current project and contains the boot file.

    If the algorithm source is a custom image and the training code has been built in the image, this parameter can be left blank.

    Image Path(optional)

    URL of the SWR image

    Boot Command

    Command for starting the training job, for example, bash /home/work/run_train.sh python {Python boot file and parameters}. This parameter is displayed if Algorithm source is set to Custom.

    If the command does not contain the --data_url or --train_url parameter, the tool automatically adds the two parameters to the end of the command when submitting the training job. The two parameters correspond to the OBS path for storing training data and the OBS path for storing training output, respectively.

    Data OBS Path

    OBS path for storing training data, for example, /test-modelarts2/mnist/dataset-mnist/, in which test-modelarts2 indicates a bucket name.

    Training OBS Path

    OBS path. A directory is automatically created in the path for storing a trained model and training logs.

    Running Parameters

    Running parameters. Add running parameters to your code based on your needs. Separate multiple running parameters with semicolons (;), for example, key1=value1;key2=value2. This parameter can be left blank.

    Specifications

    Type of resources used for training. Currently, public resource pools and dedicated resource pools are supported.

    Dedicated resource pool specifications are identified by Dedicated Resource Pool. Dedicated resource pool specifications are displayed only for users who have purchased dedicated resource pools.

    Compute Nodes

    Number of compute nodes. If this parameter is set to 1, the system runs in standalone mode. If this parameter is set to a value greater than 1, the distributed computing mode is used at the background.

    Available/Total Nodes

    When Specifications is set to a dedicated resource pool, the number of available instances and the total number of instances are displayed. The value of Compute Nodes cannot exceed the number of available instances.

    Figure 2 Configuring training job parameter (public resource pool)
    Figure 3 Configuring training job parameters (dedicated resource pool)
    Figure 4 Configuring training job parameters (custom image)
  3. Click Apply and Run. Then, local code is automatically uploaded to the cloud and training is started. The training job status is displayed in the Training Log area in real time. If information similar to Current training job status: Successful is displayed in the training logs, the training job has been successfully executed.
    NOTE:
    • After you click Apply and Run, the system automatically executes the training job. To stop the training job, choose ModelArts > Training Job > Stop on the menu bar.
    • If you click Apply, the job is not started directly, and the training job settings are saved instead. To start the job, click Apply and Run.
    Figure 5 Training log example

Stopping a Job

When a training job is running, choose ModelArts > Training Job > Stop on the PyCharm menu bar to stop the training job.

Figure 6 Stopping a job

Viewing Training Logs

You can view training logs in OBS or PyCharm Toolkit.

  • Viewing training logs in OBS

    When you submit a training job, the system automatically creates a folder with the same name as the training job in the configured OBS path to store the model, logs, and code outputted during training.

    For example, when the train-job-01 job is submitted, a folder named train-job-01 is created in the test-modelarts2 bucket. In this folder, three sub-folders (output, log, and code) are created to store the outputted model, logs, and training code, respectively. Sub-folders will be created in the output folder based on your training job version. The following is an example of the folder structure:
    test-modelarts2
        |---train-job-01
             |---output 
             |---log
             |---code
  • Viewing training logs in PyCharm Toolkit

    In PyCharm Toolkit, click ModelArts Training Log in the lower right corner of the page to view the training logs.

    Figure 7 Viewing training logs

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