doc-exports/docs/modelarts/sdk-ref/modelarts_04_0181.html
Lai, Weijian 1ad28cc33e modelarts sdk-ref first version
Reviewed-by: Jiang, Beibei <beibei.jiang@t-systems.com>
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: Lai, Weijian <laiweijian4@huawei.com>
Co-committed-by: Lai, Weijian <laiweijian4@huawei.com>
2023-03-01 15:24:28 +00:00

133 lines
14 KiB
HTML

<a name="modelarts_04_0181"></a><a name="modelarts_04_0181"></a>
<h1 class="topictitle1">Creating a Visualization Job</h1>
<div id="body8662426"><div class="section" id="modelarts_04_0181__en-us_topic_0180094073_en-us_topic_0170904407_section35881040102516"><h4 class="sectiontitle">Sample Code</h4><p id="modelarts_04_0181__en-us_topic_0180094073_p32411525194514">In the ModelArts notebook instance, 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>
<div class="codecoloring" codetype="Python" id="modelarts_04_0181__en-us_topic_0180094073_screen20166152016320"><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">VisualizationJob</span>
<span class="n">session</span> <span class="o">=</span> <span class="n">Session</span><span class="p">()</span>
<span class="n">job</span> <span class="o">=</span> <span class="n">VisualizationJob</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_visualization_instance</span> <span class="o">=</span> <span class="n">job</span><span class="o">.</span><span class="n">create_visualization_job</span><span class="p">(</span><span class="n">train_url</span><span class="o">=</span><span class="s1">'/bucket/train/'</span><span class="p">,</span> <span class="n">job_name</span><span class="o">=</span><span class="s1">'visualization_job'</span><span class="p">,</span> <span class="n">job_desc</span><span class="o">=</span><span class="s1">'my visualization job'</span><span class="p">)</span>
</pre></div></td></tr></table></div>
</div>
</div>
<div class="section" id="modelarts_04_0181__en-us_topic_0180094073_en-us_topic_0170904407_section85751315416"><h4 class="sectiontitle">Parameter Description</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="modelarts_04_0181__en-us_topic_0180094073_en-us_topic_0170904407_table196759327241" frame="border" border="1" rules="all"><caption><b>Table 1 </b><strong id="modelarts_04_0181__en-us_topic_0180094073_b33531825101917">create_visualization_job</strong> request parameters</caption><thead align="left"><tr id="modelarts_04_0181__en-us_topic_0180094073_en-us_topic_0170904407_row1674173272415"><th align="left" class="cellrowborder" valign="top" width="22.343434343434346%" id="mcps1.3.2.2.2.5.1.1"><p id="modelarts_04_0181__en-us_topic_0180094073_en-us_topic_0170904407_p367417321244">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="13.747474747474747%" id="mcps1.3.2.2.2.5.1.2"><p id="modelarts_04_0181__en-us_topic_0180094073_en-us_topic_0170904407_p4674153213242">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="13.656565656565656%" id="mcps1.3.2.2.2.5.1.3"><p id="modelarts_04_0181__en-us_topic_0180094073_en-us_topic_0170904407_p1674032172414">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50.252525252525245%" id="mcps1.3.2.2.2.5.1.4"><p id="modelarts_04_0181__en-us_topic_0180094073_en-us_topic_0170904407_p1866917542396">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="modelarts_04_0181__en-us_topic_0180094073_en-us_topic_0170904407_row15675193219249"><td class="cellrowborder" valign="top" width="22.343434343434346%" headers="mcps1.3.2.2.2.5.1.1 "><p id="modelarts_04_0181__en-us_topic_0180094073_en-us_topic_0170904407_p126741032182417">job_name</p>
</td>
<td class="cellrowborder" valign="top" width="13.747474747474747%" headers="mcps1.3.2.2.2.5.1.2 "><p id="modelarts_04_0181__en-us_topic_0180094073_en-us_topic_0170904407_p2674432102419">No</p>
</td>
<td class="cellrowborder" valign="top" width="13.656565656565656%" headers="mcps1.3.2.2.2.5.1.3 "><p id="modelarts_04_0181__en-us_topic_0180094073_en-us_topic_0170904407_p667553211247">String</p>
</td>
<td class="cellrowborder" valign="top" width="50.252525252525245%" headers="mcps1.3.2.2.2.5.1.4 "><p id="modelarts_04_0181__en-us_topic_0180094073_en-us_topic_0170904407_p10675123272415">Name of a visualization job. The value is a string of 1 to 20 characters consisting of only digits, letters, underscores (_), and hyphens (-).</p>
</td>
</tr>
<tr id="modelarts_04_0181__en-us_topic_0180094073_en-us_topic_0170904407_row196751932142417"><td class="cellrowborder" valign="top" width="22.343434343434346%" headers="mcps1.3.2.2.2.5.1.1 "><p id="modelarts_04_0181__en-us_topic_0180094073_en-us_topic_0170904407_p4675932152410">job_desc</p>
</td>
<td class="cellrowborder" valign="top" width="13.747474747474747%" headers="mcps1.3.2.2.2.5.1.2 "><p id="modelarts_04_0181__en-us_topic_0180094073_en-us_topic_0170904407_p1967503217244">No</p>
</td>
<td class="cellrowborder" valign="top" width="13.656565656565656%" headers="mcps1.3.2.2.2.5.1.3 "><p id="modelarts_04_0181__en-us_topic_0180094073_en-us_topic_0170904407_p106755321246">String</p>
</td>
<td class="cellrowborder" valign="top" width="50.252525252525245%" headers="mcps1.3.2.2.2.5.1.4 "><p id="modelarts_04_0181__en-us_topic_0180094073_en-us_topic_0170904407_p5675153202417">Description of a visualization job. The value is a string of 0 to 256 characters. By default, this parameter is left blank.</p>
</td>
</tr>
<tr id="modelarts_04_0181__en-us_topic_0180094073_en-us_topic_0170904407_row2067513212417"><td class="cellrowborder" valign="top" width="22.343434343434346%" headers="mcps1.3.2.2.2.5.1.1 "><p id="modelarts_04_0181__en-us_topic_0180094073_en-us_topic_0170904407_p18675632162419">train_url</p>
</td>
<td class="cellrowborder" valign="top" width="13.747474747474747%" headers="mcps1.3.2.2.2.5.1.2 "><p id="modelarts_04_0181__en-us_topic_0180094073_en-us_topic_0170904407_p1767519321242">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="13.656565656565656%" headers="mcps1.3.2.2.2.5.1.3 "><p id="modelarts_04_0181__en-us_topic_0180094073_en-us_topic_0170904407_p1267518326249">String</p>
</td>
<td class="cellrowborder" valign="top" width="50.252525252525245%" headers="mcps1.3.2.2.2.5.1.4 "><p id="modelarts_04_0181__en-us_topic_0180094073_en-us_topic_0170904407_p8675032122411">OBS path to the visualization file. The visualization file is provided for the visualization job to read and display, and is usually located in the training output path. The visualization file is generated by the <span class="filepath" id="modelarts_04_0181__en-us_topic_0180094073_filepath17556161082617"><b>tf.summary</b></span> or <span class="filepath" id="modelarts_04_0181__en-us_topic_0180094073_filepath1836110160265"><b>tensorboardx.SummaryWriter</b></span> module in the training code, and the file name usually starts with <span class="filepath" id="modelarts_04_0181__en-us_topic_0180094073_filepath919219254264"><b>events.out.tfevents</b></span>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="modelarts_04_0181__en-us_topic_0180094073_en-us_topic_0170904407_table973120224596" frame="border" border="1" rules="all"><caption><b>Table 2 </b><strong id="modelarts_04_0181__en-us_topic_0180094073_b14894121582113">create_visualization_job</strong> response parameters</caption><thead align="left"><tr id="modelarts_04_0181__en-us_topic_0180094073_en-us_topic_0170904407_row2731522195910"><th align="left" class="cellrowborder" valign="top" width="24.91249124912491%" id="mcps1.3.2.3.2.4.1.1"><p id="modelarts_04_0181__en-us_topic_0180094073_en-us_topic_0170904407_p57306225598">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="22.172217221722175%" id="mcps1.3.2.3.2.4.1.2"><p id="modelarts_04_0181__en-us_topic_0180094073_en-us_topic_0170904407_p117308225593">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="52.91529152915292%" id="mcps1.3.2.3.2.4.1.3"><p id="modelarts_04_0181__en-us_topic_0180094073_en-us_topic_0170904407_p2730132255915">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="modelarts_04_0181__en-us_topic_0180094073_en-us_topic_0170904407_row1873172215912"><td class="cellrowborder" valign="top" width="24.91249124912491%" headers="mcps1.3.2.3.2.4.1.1 "><p id="modelarts_04_0181__en-us_topic_0180094073_en-us_topic_0170904407_p4731322145919">VisualizationJob</p>
</td>
<td class="cellrowborder" valign="top" width="22.172217221722175%" headers="mcps1.3.2.3.2.4.1.2 "><p id="modelarts_04_0181__en-us_topic_0180094073_en-us_topic_0170904407_p117311922115916">Object</p>
</td>
<td class="cellrowborder" valign="top" width="52.91529152915292%" headers="mcps1.3.2.3.2.4.1.3 "><p id="modelarts_04_0181__en-us_topic_0180094073_en-us_topic_0170904407_p6731182225914">Visualization job object. This object contains attributes such as <strong id="modelarts_04_0181__en-us_topic_0180094073_b44361712102210">visualization_id</strong>, <strong id="modelarts_04_0181__en-us_topic_0180094073_b3205121517227">create_time</strong>, <strong id="modelarts_04_0181__en-us_topic_0180094073_b585410171222">job_name</strong>, and <strong id="modelarts_04_0181__en-us_topic_0180094073_b1710019208223">status</strong>, and operations on a visualization job, such as querying, modifying, stopping, restarting, or deleting the visualization job.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="modelarts_04_0181__en-us_topic_0180094073_en-us_topic_0170904407_table55928961173927" frame="border" border="1" rules="all"><caption><b>Table 3 </b><strong id="modelarts_04_0181__en-us_topic_0180094073_b3741957132513">VisualizationJob</strong> parameters</caption><thead align="left"><tr id="modelarts_04_0181__en-us_topic_0180094073_en-us_topic_0170904407_row40618446173927"><th align="left" class="cellrowborder" valign="top" width="25.990000000000002%" id="mcps1.3.2.4.2.4.1.1"><p id="modelarts_04_0181__en-us_topic_0180094073_en-us_topic_0170904407_p1631242217407">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="29.57%" id="mcps1.3.2.4.2.4.1.2"><p id="modelarts_04_0181__en-us_topic_0180094073_en-us_topic_0170904407_p5427574117407">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="44.440000000000005%" id="mcps1.3.2.4.2.4.1.3"><p id="modelarts_04_0181__en-us_topic_0180094073_en-us_topic_0170904407_p3425893817407">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="modelarts_04_0181__en-us_topic_0180094073_en-us_topic_0170904407_row63643119173927"><td class="cellrowborder" valign="top" width="25.990000000000002%" headers="mcps1.3.2.4.2.4.1.1 "><p id="modelarts_04_0181__en-us_topic_0180094073_en-us_topic_0170904407_p4854563511735">create_time</p>
</td>
<td class="cellrowborder" valign="top" width="29.57%" headers="mcps1.3.2.4.2.4.1.2 "><p id="modelarts_04_0181__en-us_topic_0180094073_en-us_topic_0170904407_p3988237811735">Long</p>
</td>
<td class="cellrowborder" valign="top" width="44.440000000000005%" headers="mcps1.3.2.4.2.4.1.3 "><p id="modelarts_04_0181__en-us_topic_0180094073_en-us_topic_0170904407_p924721411735">Time when a visualization job is created</p>
</td>
</tr>
<tr id="modelarts_04_0181__en-us_topic_0180094073_en-us_topic_0170904407_row37532874173927"><td class="cellrowborder" valign="top" width="25.990000000000002%" headers="mcps1.3.2.4.2.4.1.1 "><p id="modelarts_04_0181__en-us_topic_0180094073_en-us_topic_0170904407_p5106217311735">job_name</p>
</td>
<td class="cellrowborder" valign="top" width="29.57%" headers="mcps1.3.2.4.2.4.1.2 "><p id="modelarts_04_0181__en-us_topic_0180094073_en-us_topic_0170904407_p4239538711735">String</p>
</td>
<td class="cellrowborder" valign="top" width="44.440000000000005%" headers="mcps1.3.2.4.2.4.1.3 "><p id="modelarts_04_0181__en-us_topic_0180094073_en-us_topic_0170904407_p1147433311735">Name of a visualization job</p>
</td>
</tr>
<tr id="modelarts_04_0181__en-us_topic_0180094073_en-us_topic_0170904407_row17865131833214"><td class="cellrowborder" valign="top" width="25.990000000000002%" headers="mcps1.3.2.4.2.4.1.1 "><p id="modelarts_04_0181__en-us_topic_0180094073_en-us_topic_0170904407_p2880185010304">status</p>
</td>
<td class="cellrowborder" valign="top" width="29.57%" headers="mcps1.3.2.4.2.4.1.2 "><p id="modelarts_04_0181__en-us_topic_0180094073_en-us_topic_0170904407_p0880205010309">Byte</p>
</td>
<td class="cellrowborder" valign="top" width="44.440000000000005%" headers="mcps1.3.2.4.2.4.1.3 "><p id="modelarts_04_0181__en-us_topic_0180094073_en-us_topic_0170904407_p4587851163110">Status of a visualization job. For details about the job statuses, see <a href="modelarts_04_0077.html">Job Statuses</a>.</p>
</td>
</tr>
<tr id="modelarts_04_0181__en-us_topic_0180094073_en-us_topic_0170904407_row43014622173927"><td class="cellrowborder" valign="top" width="25.990000000000002%" headers="mcps1.3.2.4.2.4.1.1 "><p id="modelarts_04_0181__en-us_topic_0180094073_en-us_topic_0170904407_p44905214173316">job_id</p>
</td>
<td class="cellrowborder" valign="top" width="29.57%" headers="mcps1.3.2.4.2.4.1.2 "><p id="modelarts_04_0181__en-us_topic_0180094073_en-us_topic_0170904407_p15197337173316">String</p>
</td>
<td class="cellrowborder" valign="top" width="44.440000000000005%" headers="mcps1.3.2.4.2.4.1.3 "><p id="modelarts_04_0181__en-us_topic_0180094073_en-us_topic_0170904407_p23024745173316">ID of a visualization job</p>
</td>
</tr>
<tr id="modelarts_04_0181__en-us_topic_0180094073_en-us_topic_0170904407_row179710301819"><td class="cellrowborder" valign="top" width="25.990000000000002%" headers="mcps1.3.2.4.2.4.1.1 "><p id="modelarts_04_0181__en-us_topic_0180094073_en-us_topic_0170904407_p149820301484">is_success</p>
</td>
<td class="cellrowborder" valign="top" width="29.57%" headers="mcps1.3.2.4.2.4.1.2 "><p id="modelarts_04_0181__en-us_topic_0180094073_en-us_topic_0170904407_p69819301282">Boolean</p>
</td>
<td class="cellrowborder" valign="top" width="44.440000000000005%" headers="mcps1.3.2.4.2.4.1.3 "><p id="modelarts_04_0181__en-us_topic_0180094073_en-us_topic_0170904407_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_0180.html">Visualization Jobs</a></div>
</div>
</div>