Running TAO Toolkit on Google Colab

I have been attempting to execute the Tao Toolkit in Google Colab. The predefined starting shells are running successfully, but when it comes to executing the Tao command, it shows “command not found.” Please provide a solution for this issue.

Shell where i am getting error.

!tao yolo_v4_tiny dataset_convert -d $SPECS_DIR/yolo_v4_tiny_tfrecords_kitti_train.txt \
                             -o $DATA_DIR/train/tfrecords/train

Error:-
/bin/bash: line 1: tao: command not found

Link to the colab notebook

Please help…

From the log, there are installing issues when run setup.sh in the cell 2.3 Setup Python environment. The reason is that colab can only run under Ubuntu 22.04 now which is not compatible with TAO requirement(TAO Toolkit Quick Start Guide - NVIDIA Docs).
We provided the way to change to py38 instead. See nvidia-tao/pytorch/setup_env.sh at main · NVIDIA-AI-IOT/nvidia-tao · GitHub.
Internal team is still working on that for pytorch and tensorflow versions. Will update to you if I have. Thanks.

HI @Morganh thankyou so much for the Quick reply.

According to your suggestion i have implemented steps given to change to py38. cell 2.3 Setup Python environment which resolved the error. But the error is same “/bin/bash: line 1: tao: command not found”.

please see the notebook and let me know if i am wrong.

I don’t have the suitable Local machine for implementation and i have only option as Google colab.
Please help thank you in adavnce.

Beside changing to py38, there are other steps needed. Such as, install tao wheels, etc. You can find in setup_env.sh.
We’re still working on that. Will update to you if I have.
Temporally, you can try on Cloud machines. Running TAO Toolkit in the Cloud - NVIDIA Docs.

Hi @Morganh

As you said i have run the commands from the setup_env.sh but i have got the error with version of nvidia-tao-pyt.

!python3.8 -m pip install nvidia-tao-pyt

> ERROR: Could not find a version that satisfies the requirement nvidia-tao-pyt (from versions: none)
> ERROR: No matching distribution found for nvidia-tao-pyt

Here is the another error which i received while executing

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
open-clip-torch 2.20.0 requires sentencepiece, which is not installed.
launchpadlib 1.10.16 requires httplib2, which is not installed.
nvidia-tao 5.0.0 requires idna==2.10, but you have idna 3.6 which is incompatible.
nvidia-tao 5.0.0 requires six==1.15.0, but you have six 1.16.0 which is incompatible.
nvidia-tao 5.0.0 requires tabulate==0.8.7, but you have tabulate 0.9.0 which is incompatible.

When the python environment setup is done later i get this error where it says :-

!tao yolo_v4_tiny dataset_convert -d $SPECS_DIR/yolo_v4_tiny_tfrecords_kitti_train.txt \
                             -o $DATA_DIR/train/tfrecords/train

usage: tao [-h] {dataset,deploy,model} ...
tao: error: invalid choice: 'yolo_v4_tiny' (choose from 'dataset', 'deploy', 'model')

Here is the colab notebook .

For running google colab, some networks are from pytorch stack.
See nvidia-tao/pytorch at main · NVIDIA-AI-IOT/nvidia-tao · GitHub
Some are from tensorflow stack. See nvidia-tao/tensorflow at main · NVIDIA-AI-IOT/nvidia-tao · GitHub.

For pytorch, after checking, one line is needed to modify. nvidia-tao/pytorch/setup_env.sh at main · NVIDIA-AI-IOT/nvidia-tao · GitHub.
Change it to

python3.8 -m pip install nvidia-tao-pytorch==5.1.0

Then you can run action_recognition or pose_classification network.

For tensorflow stack, the nvidia-tao/tensorflow/setup_env.sh at main · NVIDIA-AI-IOT/nvidia-tao · GitHub is not compatible with google colab Ubuntu22.04 runtime. So, we cannot run the networks under nvidia-tao/tensorflow at main · NVIDIA-AI-IOT/nvidia-tao · GitHub yet. Will update to you if I have.

Please let me know how much approximate time its going to take so that i can plan my execution accordingly.

We aim to fix the issues before next weekend.

Sorry for late reply. Currently, the colab notebooks can work now on ubuntu22.04.
Please run notebooks in Running TAO Toolkit on Google Colab - NVIDIA Docs

More info can be found in GitHub - NVIDIA-AI-IOT/nvidia-tao.