diff --git a/colab/01_Building_the_Hank_ai_Darknet_YOLO_Framework.ipynb b/colab/01_Building_the_Hank_ai_Darknet_YOLO_Framework.ipynb index 06a79257..b4cf7bd8 100644 --- a/colab/01_Building_the_Hank_ai_Darknet_YOLO_Framework.ipynb +++ b/colab/01_Building_the_Hank_ai_Darknet_YOLO_Framework.ipynb @@ -54,6 +54,10 @@ }, "outputs": [], "source": [ + "# Check that the google colab instance provides a GPU before starting", + "import os\n", + "assert os.environ.get(\"COLAB_GPU\"), \"GPU required. Change runtime type to GPU in Edit > Notebook settings > T4 GPU\"\n", + "\n", "# First part will install the tools we'll use to build.\n", "!sudo apt-get install build-essential git libopencv-dev cmake\n", "\n", @@ -297,4 +301,4 @@ } } ] -} \ No newline at end of file +} diff --git a/colab/02_Building_Darknet_and_DarkHelp_to_use_the_Python_interface.ipynb b/colab/02_Building_Darknet_and_DarkHelp_to_use_the_Python_interface.ipynb index 77948ee3..40aa86b1 100644 --- a/colab/02_Building_Darknet_and_DarkHelp_to_use_the_Python_interface.ipynb +++ b/colab/02_Building_Darknet_and_DarkHelp_to_use_the_Python_interface.ipynb @@ -40,8 +40,11 @@ }, "outputs": [], "source": [ - "# make sure the notebook is set to T4 GPU (edit->settings)\n", - "!sudo apt-get install build-essential git libopencv-dev cmake\n", + "# Check that the google colab instance provides a GPU before starting", + "import os\n", + "assert os.environ.get(\"COLAB_GPU\"), \"GPU required. Change runtime type to GPU in Edit > Notebook settings > T4 GPU\"\n", + "\n", + "!sudo apt-get install build-essential git libopencv-dev cmake\n", "\n", "%mkdir -p ~/src\n", "%cd ~/src\n", @@ -173,4 +176,4 @@ "outputs": [] } ] -} \ No newline at end of file +} diff --git a/colab/03_Training_a_new_network.ipynb b/colab/03_Training_a_new_network.ipynb index 2e80c5ee..d685cd02 100644 --- a/colab/03_Training_a_new_network.ipynb +++ b/colab/03_Training_a_new_network.ipynb @@ -59,6 +59,10 @@ { "cell_type": "code", "source": [ + "# Check that the google colab instance provides a GPU before starting", + "import os\n", + "assert os.environ.get(\"COLAB_GPU\"), \"GPU required. Change runtime type to GPU in Edit > Notebook settings > T4 GPU\"\n", + "\n", "!sudo apt-get install build-essential git libopencv-dev cmake\n", "\n", "# Make sure we have access to CUDA\n", @@ -188,4 +192,4 @@ "outputs": [] } ] -} \ No newline at end of file +}