Updated on 2025-11-18 GMT+08:00

Using JupyterLab to Develop and Debug Code Online

JupyterLab is an interactive development environment, enabling you to compile notebooks, operate terminals, edit Markdown text, enable interaction, and view CSV files and images. JupyterLab is the future mainstream development environment for developers.

ModelArts allows you to access notebook instances online using JupyterLab and develop AI models based on the PyTorch, TensorFlow, or MindSpore engines. Figure 1 shows the operation process.

Figure 1 Using JupyterLab to develop and debug code online

Constraints

There is no strict limit on the size of files loaded in JupyterLab. However, the actual processing capability is affected by system resources and configurations. If a large text file, for example, larger than 100 MB, is opened in the browser on the left of JupyterLab, the memory may be insufficient, the GUI may respond slowly, or the kernel may be interrupted. To ensure smooth and stable usage, you are advised to open a single file no larger than 100 MB.

Procedure

  1. Create a notebook instance.

    On the ModelArts management console, create a notebook instance with a proper AI engine. For details, see Creating a Notebook Instance (Default Page) or Creating a Notebook Instance (New Page).

  2. After the notebook instance is created, it is in the Running state. Locate it in the list and click Open in the Operation column to access JupyterLab.
    Figure 2 Accessing a notebook instance

  3. The Launcher page is automatically displayed. Perform required operations. For details, see JupyterLab Documentation.
    Figure 3 JupyterLab homepage

    The notebook and console kernels and versions displayed on the Launcher page vary depending on the AI engine based on which a notebook instance is created. Figure 3 shows an example only. Obtain the notebook and console kernels and versions on the management console.

  4. Upload training data and code files to JupyterLab. For details, see Uploading Files from a Local Path to JupyterLab.
    Figure 4 Button for uploading a file
  5. In the navigation pane on the left, double-click the uploaded code file, compile the file in JupyterLab, and debug it. For details about how to use JupyterLab, see Common Functions of JupyterLab.

    If your code file is in .py format, open a new .ipynb file and run the %load main.py command to load the content of the .py file to the .ipynb file for encoding and debugging.

    Figure 5 Opening a code file
  6. In JupyterLab, call the ModelArts SDK to create a training job for in-cloud training.

    For details, see Creating a Training Job.