MindInsight Documents

MindInsight is a visualized debugging and optimization tool of MindSpore. It visualizes the training process, model performance optimization, accuracy debugging, and inference result explanation. You can also use the command line provided by MindInsight to easily search for hyperparameters and migrate models. MindInsight helps you to easily obtain satisfactory model accuracy and performance.

MindInsight provides the following functions:

Using MindInsight to Visualize the Training Process

  1. Collecting Data for Visualization

    Use SummaryCollector to record the training information in the training script and then perform the training.

  2. Starting MindInsight for Visualization

    Start the MindInsight service and set the --summary-base-dir parameter to specify the directory for storing the summary log file.

  3. Viewing Training Dashboard

    Open a browser, enter the MindInsight address in the address box, and click Training Dashboard to view details.

Using MindInsight to Analyze the Model Performance

  1. Collecting Data for Analysis

    Call MindSpore Profiler APIs in the training script and then perform training.

  2. Starting MindInsight for Analysis

    Start the MindInsight service and set the --summary-base-dir parameter to specify the directory for storing the performance data.

  3. Analyzing Performance Data

    Open a browser, enter the MindInsight address in the address box, and click Profiling to view and analyze the training performance data.

Using MindInsight to Debug the Model Accuracy

  1. Starting MindInsight in Debugger Mode

    Configure the --enable-debugger True --debugger-port 50051 parameter to start MindInsight in debugger mode.

  2. Running the Training Script in Debugger Mode

    Set the environment variable export ENABLE_MS_DEBUGGER to True to specify the debugger mode for training. Set the debugging service and port to be connected for training: export MS_DEBUGGER_HOST=127.0.0.1 . export MS_DEBUGGER_PORT=50051 .Run the training script.

  3. Setting and Analyzing Watchpoints in MindInsight

    Open a browser, enter the MindInsight address in the address box, click the Debugger tab page, set the watchpoints after the training is connected, and analyze the data such as the computational graphs, tensors, and watchpoint hits to identify the root cause of the accuracy problem.

Using MindConverter to Migrate Models

  1. Exporting the ONNX Model

    Export the ONNX model from the original script. For details, see the description provided by TensorFlow or PyTorch.

  2. Migrating the Model

    Run the mindconverter command to migrate the model. After the migration, view the migration report and rectify the errors in the report.

  3. Supplementing Scripts

    Based on the backbone model definition generated by MindConverter, supplement script code such as data processing, loss function, and training loop to form a complete script.

Performance Tuning Guide