Artificial Intelligence 7 min read

How to Use the TI-ONE SDK to Train Models for the 2020 Tencent Advertising Algorithm Competition

This tutorial walks you through the complete process of using the TI-ONE SDK—including data preparation, dependency installation, session initialization, TensorFlow estimator configuration, job submission, and result monitoring—to train a machine‑learning model for the 2020 Tencent Advertising Algorithm Competition.

Tencent Advertising Technology
Tencent Advertising Technology
Tencent Advertising Technology
How to Use the TI-ONE SDK to Train Models for the 2020 Tencent Advertising Algorithm Competition

Introduction

The 2020 Tencent Advertising Algorithm Competition has launched, and the Tencent Cloud TI platform (TI‑ONE) is the officially designated machine‑learning platform for the event, providing both the SDK and compute resources.

Data Description

This example uses a demo dataset stored at cos://tesla-ap-guangzhou-1256322946/cephfs/tesla_common/deeplearning/dataset/contest/demo . You can download it locally or use it directly in a notebook. Real competition data is available after registration.

Import Dependencies

from __future__ import absolute_import, print_function
from ti import session
import sys
from ti.tensorflow import TensorFlow

Initialize Parameters

# Initialize session
ti_session = session.Session()
# Path to training data (COS prefix)
inputs = 'cos://tesla-ap-shanghai-1256322946/cephfs/tesla_common/deeplearning/dataset/contest/demo'
# Define training, test, and output paths
hyperparameters = {'train_path': '/opt/ml/input/data/training/iris_training.csv',
'test_path': '/opt/ml/input/data/training/iris_test.csv',
'result_dir': '/opt/ml/output'}
# Role authorized for TI services
role = "TIONE_QCSRole"

Build Training Task

# Create a TensorFlow Estimator
tf_estimator = TensorFlow(role=role,
train_instance_count=1,
train_instance_type='TI.3XLARGE24.12core24g',
py_version='py3',
script_mode=True,
hyperparameters=hyperparameters,
framework_version='1.14.0',
entry_point='main.py',
source_dir='code')

Submit Job and Start Training

# Submit the TensorFlow training job
tf_estimator.fit(inputs)

Training Job Request and Response

Training job request : {
"TrainingJobName": "tensorflow-2020-04-15-03-26-49-992",
"AlgorithmSpecification": {
"TrainingInputMode": "File",
"TrainingImageName": "ccr.ccs.tencentyun.com/ti_public/tensorflow:1.14.0-py3"
},
"InputDataConfig": [
{
"DataSource": {
"CosDataSource": {
"DataDistributionType": "FullyReplicated",
"DataType": "COSPrefix",
"Bucket": "tesla-ap-shanghai-1256322946",
"KeyPrefix": "cephfs/tesla_common/deeplearning/dataset/contest/demo"
}
},
"ChannelName": "training"
}
],
"OutputDataConfig": {
"CosOutputBucket": "ti-ap-shanghai-100010875047-1259675134",
"CosOutputKeyPrefix": ""
},
"ResourceConfig": {
"InstanceCount": 1,
"InstanceType": "TI.3XLARGE24.12core24g",
"VolumeSizeInGB": 0
},
"RoleName": "TIONE_QCSRole",
"StoppingCondition": {"MaxRuntimeInSeconds": 86400},
"HyperParameters": "{...}"
}
Training job response : {
"TrainingJobName": "tensorflow-2020-04-15-03-26-49-992",
"RequestId": "06bb534b-f874-4ba6-9610-1d41f5044417"
}

View Output Model

If the training completes successfully, TI‑ONE uploads the model to COS. You can specify an output_path='cos://' to set a custom bucket; otherwise TI‑ONE creates a bucket in the format ti‑region‑uin‑appid and stores the model under #{bucket}/#{job_name}/output/ .

View Training Logs

During training, logs are sent to Tencent Cloud Log Service. After enabling the service, TI‑ONE creates a log set (named TI ) and a log topic ( TrainingJob ). You can filter logs by the job name using the keyword job: #{job_name} .

Check Submission History and Monitoring

In the TI‑ONE console, go to Task List → SDK Tasks to see the history of submitted SDK jobs. Clicking a task name shows detailed information, and the Monitoring tab displays resource usage charts.

Conclusion

This article has demonstrated the end‑to‑end workflow of using the TI‑ONE SDK to train a TensorFlow model for the 2020 Tencent Advertising Algorithm Competition, covering data preparation, code setup, job submission, and result inspection.

SDKTensorFlowTencentTI-ONE
Tencent Advertising Technology
Written by

Tencent Advertising Technology

Official hub of Tencent Advertising Technology, sharing the team's latest cutting-edge achievements and advertising technology applications.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.