doc-exports/docs/modelarts/sdk-ref/modelarts_04_0162.html
Lai, Weijian eda19245f1 modelarts sdk-ref version 21.430 update
Reviewed-by: Jiang, Beibei <beibei.jiang@t-systems.com>
Reviewed-by: Rechenburg, Matthias <matthias.rechenburg@t-systems.com>
Co-authored-by: Lai, Weijian <laiweijian4@huawei.com>
Co-committed-by: Lai, Weijian <laiweijian4@huawei.com>
2023-03-20 09:32:27 +00:00

127 lines
14 KiB
HTML

<a name="modelarts_04_0162"></a><a name="modelarts_04_0162"></a>
<h1 class="topictitle1">Modifying the Description of a Training Job</h1>
<div id="body8662426"><div class="section" id="modelarts_04_0162__en-us_topic_0180094055_en-us_topic_0170904392_section35881040102516"><h4 class="sectiontitle">Sample Code</h4><p id="modelarts_04_0162__en-us_topic_0180094055_p189163115424">In ModelArts notebook, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development environments, see <a href="modelarts_04_0123.html">Session Authentication</a>.</p>
<ul id="modelarts_04_0162__en-us_topic_0180094055_ul1889011414185"><li id="modelarts_04_0162__en-us_topic_0180094055_li1489015142185">Method 1: Modify the description of a training job based on the specified <strong id="modelarts_04_0162__en-us_topic_0180094055_b732574393619">job_id</strong>.<div class="codecoloring" codetype="Python" id="modelarts_04_0162__en-us_topic_0180094055_screen20531222181819"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span>
<span class="normal">5</span></pre></div></td><td class="code"><div><pre><span></span><span class="kn">from</span> <span class="nn">modelarts.session</span> <span class="kn">import</span> <span class="n">Session</span>
<span class="kn">from</span> <span class="nn">modelarts.estimator</span> <span class="kn">import</span> <span class="n">Estimator</span>
<span class="n">session</span> <span class="o">=</span> <span class="n">Session</span><span class="p">()</span>
<span class="n">estimator</span> <span class="o">=</span> <span class="n">Estimator</span><span class="p">(</span><span class="n">modelarts_session</span><span class="o">=</span><span class="n">session</span><span class="p">,</span> <span class="n">job_id</span><span class="o">=</span><span class="s2">&quot;182626&quot;</span><span class="p">)</span>
<span class="n">job_description</span> <span class="o">=</span> <span class="n">estimator</span><span class="o">.</span><span class="n">update_job_description</span><span class="p">(</span><span class="n">description</span><span class="o">=</span><span class="s1">'update description'</span><span class="p">)</span>
</pre></div></td></tr></table></div>
</div>
</li></ul>
<ul id="modelarts_04_0162__en-us_topic_0180094055_ul6132161718189"><li id="modelarts_04_0162__en-us_topic_0180094055_li013211711184">Method 2: Modify the description of the training job created in <a href="modelarts_04_0131.html">Creating a Training Job</a>.<div class="codecoloring" codetype="Python" id="modelarts_04_0162__en-us_topic_0180094055_screen180382471810"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="n">job_description</span> <span class="o">=</span> <span class="n">job_instance</span><span class="o">.</span><span class="n">update_job_description</span><span class="p">(</span><span class="n">description</span><span class="o">=</span><span class="s1">'update description'</span><span class="p">)</span>
</pre></div></td></tr></table></div>
</div>
</li></ul>
<ul id="modelarts_04_0162__en-us_topic_0180094055_ul92441519161820"><li id="modelarts_04_0162__en-us_topic_0180094055_li10244131915184">Method 3: Modify the description of a training job version object returned in <a href="modelarts_04_0169.html">Querying the List of Training Job Versions</a>.<div class="codecoloring" codetype="Python" id="modelarts_04_0162__en-us_topic_0180094055_screen11468102791813"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="n">job_description</span> <span class="o">=</span> <span class="n">job_version_instance_list</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">update_job_description</span><span class="p">(</span><span class="n">description</span><span class="o">=</span><span class="s1">'update description'</span><span class="p">)</span>
</pre></div></td></tr></table></div>
</div>
</li></ul>
</div>
<div class="section" id="modelarts_04_0162__en-us_topic_0180094055_en-us_topic_0170904392_section85751315416"><h4 class="sectiontitle">Parameter Description</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="modelarts_04_0162__en-us_topic_0180094055_en-us_topic_0170904392_table155461191218" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Estimator request parameters</caption><thead align="left"><tr id="modelarts_04_0162__en-us_topic_0180094055_en-us_topic_0170904392_row254817912212"><th align="left" class="cellrowborder" valign="top" width="18%" id="mcps1.3.2.2.2.5.1.1"><p id="modelarts_04_0162__en-us_topic_0180094055_en-us_topic_0170904392_p12549899214">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="15%" id="mcps1.3.2.2.2.5.1.2"><p id="modelarts_04_0162__en-us_topic_0180094055_en-us_topic_0170904392_p3552101193813">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="13%" id="mcps1.3.2.2.2.5.1.3"><p id="modelarts_04_0162__en-us_topic_0180094055_en-us_topic_0170904392_p1755169172118">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="54%" id="mcps1.3.2.2.2.5.1.4"><p id="modelarts_04_0162__en-us_topic_0180094055_en-us_topic_0170904392_p55521998211">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="modelarts_04_0162__en-us_topic_0180094055_en-us_topic_0170904392_row8893215413"><td class="cellrowborder" valign="top" width="18%" headers="mcps1.3.2.2.2.5.1.1 "><p id="modelarts_04_0162__en-us_topic_0180094055_en-us_topic_0170904392_p6891421842">modelarts_session</p>
</td>
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.2.2.2.5.1.2 "><p id="modelarts_04_0162__en-us_topic_0180094055_en-us_topic_0170904392_p68972047">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="13%" headers="mcps1.3.2.2.2.5.1.3 "><p id="modelarts_04_0162__en-us_topic_0180094055_en-us_topic_0170904392_p158912219419">Object</p>
</td>
<td class="cellrowborder" valign="top" width="54%" headers="mcps1.3.2.2.2.5.1.4 "><p id="modelarts_04_0162__en-us_topic_0180094055_en-us_topic_0170904392_p1689152543">Session object. For details about the initialization method, see <a href="modelarts_04_0123.html">Session Authentication</a>.</p>
</td>
</tr>
<tr id="modelarts_04_0162__en-us_topic_0180094055_en-us_topic_0170904392_row197933582219"><td class="cellrowborder" valign="top" width="18%" headers="mcps1.3.2.2.2.5.1.1 "><p id="modelarts_04_0162__en-us_topic_0180094055_en-us_topic_0170904392_p10361105925611">job_id</p>
</td>
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.2.2.2.5.1.2 "><p id="modelarts_04_0162__en-us_topic_0180094055_en-us_topic_0170904392_p196751771039">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="13%" headers="mcps1.3.2.2.2.5.1.3 "><p id="modelarts_04_0162__en-us_topic_0180094055_en-us_topic_0170904392_p8675972311">String</p>
</td>
<td class="cellrowborder" valign="top" width="54%" headers="mcps1.3.2.2.2.5.1.4 "><p id="modelarts_04_0162__en-us_topic_0180094055_en-us_topic_0170904392_p354118145165">ID of a training job. Obtain <strong id="modelarts_04_0162__b9469181710412">job_id</strong> using the training job object generated in <a href="modelarts_04_0131.html">Creating a Training Job</a>, for example, <span class="filepath" id="modelarts_04_0162__filepath1346941754118"><b>job_instance.job_id</b></span>, or from the response in <a href="modelarts_04_0160.html">Obtaining Training Jobs</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="modelarts_04_0162__en-us_topic_0180094055_en-us_topic_0170904392_table160254042515" frame="border" border="1" rules="all"><caption><b>Table 2 </b><strong id="modelarts_04_0162__en-us_topic_0180094055_b2368358204111">update_job_description</strong> request parameters</caption><thead align="left"><tr id="modelarts_04_0162__en-us_topic_0180094055_en-us_topic_0170904392_row141641202511"><th align="left" class="cellrowborder" valign="top" width="18.181818181818183%" id="mcps1.3.2.3.2.5.1.1"><p id="modelarts_04_0162__en-us_topic_0180094055_en-us_topic_0170904392_p11941182519">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="15.151515151515152%" id="mcps1.3.2.3.2.5.1.2"><p id="modelarts_04_0162__en-us_topic_0180094055_en-us_topic_0170904392_p174034583511">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="12.121212121212121%" id="mcps1.3.2.3.2.5.1.3"><p id="modelarts_04_0162__en-us_topic_0180094055_en-us_topic_0170904392_p611141142510">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="54.545454545454554%" id="mcps1.3.2.3.2.5.1.4"><p id="modelarts_04_0162__en-us_topic_0180094055_en-us_topic_0170904392_p917419250">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="modelarts_04_0162__en-us_topic_0180094055_en-us_topic_0170904392_row7987834153220"><td class="cellrowborder" valign="top" width="18.181818181818183%" headers="mcps1.3.2.3.2.5.1.1 "><p id="modelarts_04_0162__en-us_topic_0180094055_en-us_topic_0170904392_p1798914349321">description</p>
</td>
<td class="cellrowborder" valign="top" width="15.151515151515152%" headers="mcps1.3.2.3.2.5.1.2 "><p id="modelarts_04_0162__en-us_topic_0180094055_en-us_topic_0170904392_p164038584515">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="12.121212121212121%" headers="mcps1.3.2.3.2.5.1.3 "><p id="modelarts_04_0162__en-us_topic_0180094055_en-us_topic_0170904392_p49909340326">String</p>
</td>
<td class="cellrowborder" valign="top" width="54.545454545454554%" headers="mcps1.3.2.3.2.5.1.4 "><p id="modelarts_04_0162__en-us_topic_0180094055_en-us_topic_0170904392_p15990203433217">Description of the training job to be modified</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="modelarts_04_0162__en-us_topic_0180094055_en-us_topic_0170904392_table15800151410195" frame="border" border="1" rules="all"><caption><b>Table 3 </b><strong id="modelarts_04_0162__en-us_topic_0180094055_en-us_topic_0170904392_b1799153513124">update_job_description</strong> response parameters</caption><thead align="left"><tr id="modelarts_04_0162__en-us_topic_0180094055_en-us_topic_0170904392_row148498143191"><th align="left" class="cellrowborder" valign="top" width="18.181818181818183%" id="mcps1.3.2.4.2.4.1.1"><p id="modelarts_04_0162__en-us_topic_0180094055_en-us_topic_0170904392_p18849101416197">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="15.151515151515152%" id="mcps1.3.2.4.2.4.1.2"><p id="modelarts_04_0162__en-us_topic_0180094055_en-us_topic_0170904392_p68495141195">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="66.66666666666667%" id="mcps1.3.2.4.2.4.1.3"><p id="modelarts_04_0162__en-us_topic_0180094055_en-us_topic_0170904392_p128491314141913">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="modelarts_04_0162__en-us_topic_0180094055_en-us_topic_0170904392_row98495147194"><td class="cellrowborder" valign="top" width="18.181818181818183%" headers="mcps1.3.2.4.2.4.1.1 "><p id="modelarts_04_0162__en-us_topic_0180094055_en-us_topic_0170904392_p1284912140194">error_msg</p>
</td>
<td class="cellrowborder" valign="top" width="15.151515151515152%" headers="mcps1.3.2.4.2.4.1.2 "><p id="modelarts_04_0162__en-us_topic_0180094055_en-us_topic_0170904392_p12849614161915">String</p>
</td>
<td class="cellrowborder" valign="top" width="66.66666666666667%" headers="mcps1.3.2.4.2.4.1.3 "><p id="modelarts_04_0162__en-us_topic_0180094055_en-us_topic_0170904392_p17849191410198">Error message when the API call fails.</p>
<p id="modelarts_04_0162__en-us_topic_0180094055_en-us_topic_0170904392_p10849131418198">This parameter is not included when the API call succeeds.</p>
</td>
</tr>
<tr id="modelarts_04_0162__en-us_topic_0180094055_en-us_topic_0170904392_row15849314161912"><td class="cellrowborder" valign="top" width="18.181818181818183%" headers="mcps1.3.2.4.2.4.1.1 "><p id="modelarts_04_0162__en-us_topic_0180094055_en-us_topic_0170904392_p17849171481919">error_code</p>
</td>
<td class="cellrowborder" valign="top" width="15.151515151515152%" headers="mcps1.3.2.4.2.4.1.2 "><p id="modelarts_04_0162__en-us_topic_0180094055_en-us_topic_0170904392_p18851101421917">String</p>
</td>
<td class="cellrowborder" valign="top" width="66.66666666666667%" headers="mcps1.3.2.4.2.4.1.3 "><p id="modelarts_04_0162__en-us_topic_0180094055_en-us_topic_0170904392_p138061328696">Error code when the API fails to be called. For details, see <a href="https://docs.otc.t-systems.com/modelarts/api-ref/common_parameters/error_codes.html" target="_blank" rel="noopener noreferrer">Error Codes</a> in <em id="modelarts_04_0162__i571623014119">ModelArts API Reference</em>.</p>
<p id="modelarts_04_0162__en-us_topic_0180094055_en-us_topic_0170904392_p19851101441914">This parameter is not included when the API call succeeds.</p>
</td>
</tr>
<tr id="modelarts_04_0162__en-us_topic_0180094055_en-us_topic_0170904392_row22623530479"><td class="cellrowborder" valign="top" width="18.181818181818183%" headers="mcps1.3.2.4.2.4.1.1 "><p id="modelarts_04_0162__en-us_topic_0180094055_en-us_topic_0170904392_p123221015210">is_success</p>
</td>
<td class="cellrowborder" valign="top" width="15.151515151515152%" headers="mcps1.3.2.4.2.4.1.2 "><p id="modelarts_04_0162__en-us_topic_0180094055_en-us_topic_0170904392_p923219101219">Boolean</p>
</td>
<td class="cellrowborder" valign="top" width="66.66666666666667%" headers="mcps1.3.2.4.2.4.1.3 "><p id="modelarts_04_0162__en-us_topic_0180094055_en-us_topic_0170904392_p14433359122514">Whether the API call succeeds</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="modelarts_04_0158.html">Training Jobs</a></div>
</div>
</div>