Skip to content

5. Run in Colab Notebook

Jing Jin edited this page May 7, 2024 · 15 revisions

Model Explorer can be used directly in a Colab Notebook to visualize models accessible within its runtime. Check out this example notebook for reference.

Installation

Note that the installation command is Colab-specific.

!pip install --no-deps model-explorer-adapter model-explorer

Run

You can use the same APIs described in the API Guide. For example:

import model_explorer

model_explorer.visualize('/path/to/model')

After running the cell, Model Explorer will be displayed in a cell-embedded iFrame. You can use the colab_height parameter to control the height of the UI. Click the "Open in new tab" button to show the UI in a separate tab.

Important

Model Explorer UI elements are saved in your notebook but require the generating cell to be re-executed each session to function. Always re-run the relevant cell when reopening the notebook.

Clone this wiki locally