diff --git a/01_materials/labs/lab_1.ipynb b/01_materials/labs/lab_1.ipynb index 667fd306e..25b751340 100644 --- a/01_materials/labs/lab_1.ipynb +++ b/01_materials/labs/lab_1.ipynb @@ -35,6 +35,31 @@ "metadata": {}, "outputs": [], "source": [ + "## Tensorflow GPU disabled by default. Comment the following lines to enable GPU if you have a working CUDA installation.\n", + "import tensorflow as tf\n", + "\n", + "try:\n", + " # Disable all GPUs\n", + " tf.config.set_visible_devices([], 'GPU')\n", + "\n", + " visible_devices = tf.config.get_visible_devices()\n", + " for device in visible_devices:\n", + " assert device.device_type != 'GPU'\n", + " print(\"GPUs disabled, using CPU.\")\n", + "\n", + "except:\n", + " # Invalid device or cannot modify virtual devices once initialized.\n", + " pass" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "\n", + "\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", "\n", @@ -813,7 +838,7 @@ "metadata": { "file_extension": ".py", "kernelspec": { - "display_name": ".venv", + "display_name": "deep-learning-env", "language": "python", "name": "python3" }, @@ -827,7 +852,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.12.12" + "version": "3.11.14" }, "mimetype": "text/x-python", "name": "python", diff --git a/01_materials/labs/lab_3.ipynb b/01_materials/labs/lab_3.ipynb index 7ac8da00d..ef6d808c7 100644 --- a/01_materials/labs/lab_3.ipynb +++ b/01_materials/labs/lab_3.ipynb @@ -13,6 +13,29 @@ "We will download a subset of the dataset containing 100k ratings. There are tens of millions of ratings in the full dataset, spanning hundreds of thousands of users and movies. The subset we'll be using is a good example to demonstrate the concepts in this lab." ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "## Tensorflow GPU disabled by default. Comment the following lines to enable GPU if you have a working CUDA installation.\n", + "import tensorflow as tf\n", + "\n", + "try:\n", + " # Disable all GPUs\n", + " tf.config.set_visible_devices([], 'GPU')\n", + "\n", + " visible_devices = tf.config.get_visible_devices()\n", + " for device in visible_devices:\n", + " assert device.device_type != 'GPU'\n", + " print(\"GPUs disabled, using CPU.\")\n", + "\n", + "except:\n", + " # Invalid device or cannot modify virtual devices once initialized.\n", + " pass" + ] + }, { "cell_type": "code", "execution_count": null, diff --git a/01_materials/labs/lab_4.ipynb b/01_materials/labs/lab_4.ipynb index 49316d21a..bfa4a878d 100644 --- a/01_materials/labs/lab_4.ipynb +++ b/01_materials/labs/lab_4.ipynb @@ -22,6 +22,29 @@ "We'll use the `skimage` library to read and process images. It's a library dedicated to image processing, which is part of the `scikit-learn` family." ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "## Tensorflow GPU disabled by default. Comment the following lines to enable GPU if you have a working CUDA installation.\n", + "import tensorflow as tf\n", + "\n", + "try:\n", + " # Disable all GPUs\n", + " tf.config.set_visible_devices([], 'GPU')\n", + "\n", + " visible_devices = tf.config.get_visible_devices()\n", + " for device in visible_devices:\n", + " assert device.device_type != 'GPU'\n", + " print(\"GPUs disabled, using CPU.\")\n", + "\n", + "except:\n", + " # Invalid device or cannot modify virtual devices once initialized.\n", + " pass" + ] + }, { "cell_type": "code", "execution_count": null, @@ -718,7 +741,7 @@ "provenance": [] }, "kernelspec": { - "display_name": "lab_1", + "display_name": "deep-learning-env", "language": "python", "name": "python3" }, @@ -732,7 +755,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.12.9" + "version": "3.11.14" } }, "nbformat": 4, diff --git a/01_materials/labs/lab_5.ipynb b/01_materials/labs/lab_5.ipynb index 4d8869e8b..8695395a9 100644 --- a/01_materials/labs/lab_5.ipynb +++ b/01_materials/labs/lab_5.ipynb @@ -17,6 +17,29 @@ "We will use the Pascal VOC 2007 dataset, which contains 20 classes of objects. We will only use 5 classes: \"dog\", \"cat\", \"bus\", \"car\", \"aeroplane\". To get started, we will use a pre-trained ResNet50 model to precompute the convolutional representations of the images. We will then build a simple model to predict the class and the bounding box of the object in the image." ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "## Tensorflow GPU disabled by default. Comment the following lines to enable GPU if you have a working CUDA installation.\n", + "import tensorflow as tf\n", + "\n", + "try:\n", + " # Disable all GPUs\n", + " tf.config.set_visible_devices([], 'GPU')\n", + "\n", + " visible_devices = tf.config.get_visible_devices()\n", + " for device in visible_devices:\n", + " assert device.device_type != 'GPU'\n", + " print(\"GPUs disabled, using CPU.\")\n", + "\n", + "except:\n", + " # Invalid device or cannot modify virtual devices once initialized.\n", + " pass" + ] + }, { "cell_type": "code", "execution_count": null, diff --git a/01_materials/labs/lab_6.ipynb b/01_materials/labs/lab_6.ipynb index c9685c873..8d3c4c5cc 100644 --- a/01_materials/labs/lab_6.ipynb +++ b/01_materials/labs/lab_6.ipynb @@ -14,6 +14,29 @@ "- Use these pre-trained embeddings" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "## Tensorflow GPU disabled by default. Comment the following lines to enable GPU if you have a working CUDA installation.\n", + "import tensorflow as tf\n", + "\n", + "try:\n", + " # Disable all GPUs\n", + " tf.config.set_visible_devices([], 'GPU')\n", + "\n", + " visible_devices = tf.config.get_visible_devices()\n", + " for device in visible_devices:\n", + " assert device.device_type != 'GPU'\n", + " print(\"GPUs disabled, using CPU.\")\n", + "\n", + "except:\n", + " # Invalid device or cannot modify virtual devices once initialized.\n", + " pass" + ] + }, { "cell_type": "markdown", "metadata": {}, diff --git a/pyproject.toml b/pyproject.toml index 97292d176..48e8dd1c4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "deep-learning-env" -version = "0.1.0" +version = "0.1.2" requires-python = ">=3.11" dependencies = [ "ipykernel>=6.30.1", @@ -8,14 +8,19 @@ dependencies = [ "ipython>=9.5.0", "keras>=3.11.3", "matplotlib>=3.10.6", + "umap-learn==0.5.7", "numpy>=2.3.3", "plotly>=6.3.0", "scikit-image>=0.25.2", - "scikit-learn>=1.7.2", + "scikit-learn>=1.6.0,<1.7", "seaborn>=0.13.2", "sequence>=0.8.0", "tensorflow>=2.20.0", "torch>=2.8.0", "torchvision>=0.23.0", - "umap>=0.1.1", + "llvmlite>=0.45.0", + "transformers>=4.51.0", + "accelerate>=1.6.0", + "jupyter>=1.1.1", + "jupyterlab>=4.3.0" ]