Skip to content

5. Run in Colab Notebook

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

Model Explorer can be used directly in a Colab Notebook to visualize models accessible within its runtime. Check out the quick start Colab.

Installation

!pip install ai-edge-model-explorer

For a faster installation, run the following command. It skips the installation of most of the dependency packages which are already included in the default Colab runtime.

!pip install --no-deps ai-edge-model-explorer-adapter ai-edge-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