Skip to content

Commit 90d2017

Browse files
committed
differences for PR #587
1 parent 4de7ad2 commit 90d2017

File tree

6 files changed

+140
-42
lines changed

6 files changed

+140
-42
lines changed

3-monitor-the-model.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ into a local folder and load the data using the code below.
7272
```python
7373
import pandas as pd
7474

75-
filename_data = "weather_prediction_dataset_light.csv"
75+
filename_data = "data/weather_prediction_dataset_light.csv"
7676
data = pd.read_csv(filename_data)
7777
data.head()
7878
```

4-advanced-layer-types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ The [MLCommons Dollar Street Dataset](https://www.kaggle.com/datasets/mlcommons/
3535
import pathlib
3636
import numpy as np
3737

38-
DATA_FOLDER = pathlib.Path('data/dataset_dollarstreet/') # change to location where you stored the data
38+
DATA_FOLDER = pathlib.Path('data/') # change to location where you stored the data
3939
train_images = np.load(DATA_FOLDER / 'train_images.npy')
4040
val_images = np.load(DATA_FOLDER / 'test_images.npy')
4141
train_labels = np.load(DATA_FOLDER / 'train_labels.npy')

5-transfer-learning.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ We load the data in the same way as the previous episode:
4141
import pathlib
4242
import numpy as np
4343

44-
DATA_FOLDER = pathlib.Path('data/dataset_dollarstreet/') # change to location where you stored the data
44+
DATA_FOLDER = pathlib.Path('data/') # change to location where you stored the data
4545
train_images = np.load(DATA_FOLDER / 'train_images.npy')
4646
val_images = np.load(DATA_FOLDER / 'test_images.npy')
4747
train_labels = np.load(DATA_FOLDER / 'train_labels.npy')

fig/.gitkeep

Whitespace-only changes.

md5sum.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@
77
"workshops.md" "ba594ced8acc714eb6785d1c63191bb8" "site/built/workshops.md" "2025-05-07"
88
"episodes/1-introduction.md" "8dabfa4853b660c8bfcb0aea5f435029" "site/built/1-introduction.md" "2025-02-11"
99
"episodes/2-keras.md" "ebddf0ec35a0e97735a1ea7f1d204a40" "site/built/2-keras.md" "2025-02-11"
10-
"episodes/3-monitor-the-model.md" "93984f2bd862ddc2f10ba6749950b719" "site/built/3-monitor-the-model.md" "2025-02-11"
11-
"episodes/4-advanced-layer-types.md" "97b49e9dad76479bcfe608f0de2d52a4" "site/built/4-advanced-layer-types.md" "2025-02-11"
12-
"episodes/5-transfer-learning.md" "5808f2218c3f2d2d400e1ec1ad9f1f3c" "site/built/5-transfer-learning.md" "2025-02-11"
10+
"episodes/3-monitor-the-model.md" "1763a6c4baeb9e1bcc08abf60a514d89" "site/built/3-monitor-the-model.md" "2025-05-18"
11+
"episodes/4-advanced-layer-types.md" "1f1911414502d92cc36eee139a751890" "site/built/4-advanced-layer-types.md" "2025-05-18"
12+
"episodes/5-transfer-learning.md" "7410e21a68de7ad807de4a543d970ded" "site/built/5-transfer-learning.md" "2025-05-18"
1313
"episodes/6-outlook.md" "007728216562f3b52b983ff1908af5b7" "site/built/6-outlook.md" "2025-02-11"
1414
"instructors/bonus-material.md" "382832ea4eb097fc7781cb36992c1955" "site/built/bonus-material.md" "2025-02-11"
1515
"instructors/design.md" "1537f9d0c90cdfdb1781bd3daf94dadd" "site/built/design.md" "2025-02-11"
1616
"instructors/instructor-notes.md" "73b56a12ce196586a580b9399e2d49fc" "site/built/instructor-notes.md" "2025-02-11"
1717
"instructors/schedule.md" "332b32d24f144b29a280176e6b5d015f" "site/built/schedule.md" "2025-03-10"
1818
"instructors/survey-templates.md" "ea5d46e7b54d335f79e57a7bc31d1c5c" "site/built/survey-templates.md" "2025-02-11"
1919
"learners/reference.md" "e47218673643f23431c540c2d3b27868" "site/built/reference.md" "2025-02-11"
20-
"learners/setup.md" "f640f3d679d73aad199d11e53590cb3a" "site/built/setup.md" "2025-02-11"
20+
"learners/setup.md" "4044d676bf3ef326daa3e01c4671b26f" "site/built/setup.md" "2025-05-18"
2121
"paper/paper.md" "5257d2bb9c07be835c20d66855c38202" "site/built/paper.md" "2025-03-03"
2222
"profiles/learner-profiles.md" "ef0f26dd0874387d80ed3fd468b99e23" "site/built/learner-profiles.md" "2025-02-11"

setup.md

Lines changed: 133 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,96 @@
11
---
22
title: Setup
33
---
4-
## Software Setup
4+
## Setup
5+
Please complete the setup at least a day in advance of the workshop. If you run into issues, contact the workshop organizers by email so you're ready to begin on time. The setup steps include:
56

6-
::::::::::::::::::::::::::::::::::::::: discussion
7+
1. Setup workshop folder
8+
2. Install Python 3.11.9
9+
3. Setup virtual environment with required packages
10+
4. Download the data
711

8-
### Installing Python
12+
## 1. Setup workshop folder
913

10-
[Python][python] is a popular language for scientific computing, and a frequent choice
11-
for machine learning as well.
12-
To install Python, follow the [Beginner's Guide](https://wiki.python.org/moin/BeginnersGuide/Download) or head straight to the [download page](https://www.python.org/downloads/).
14+
Create a folder on your desktop called `dl_workshop` for storing the workshop data and required packages.
1315

14-
Please set up your python environment at least a day in advance of the workshop.
15-
If you encounter problems with the installation procedure, ask your workshop organizers via e-mail for assistance so
16-
you are ready to go as soon as the workshop begins.
16+
```shell
17+
cd ~/Desktop
18+
mkdir dl_workshop
19+
cd dl_workshop
20+
pwd
21+
```
1722

18-
:::::::::::::::::::::::::::::::::::::::::::::::::::
23+
```output
24+
~/Desktop/dl_workshop
25+
```
1926

20-
## Installing the required packages{#packages}
27+
## 2. Installing Python
2128

22-
[Pip](https://pip.pypa.io/en/stable/) is the package management system built into Python.
23-
Pip should be available in your system once you installed Python successfully.
29+
[Python][python] is a popular language for scientific computing and a frequent choice for machine learning.
2430

25-
Open a terminal (Mac/Linux) or Command Prompt (Windows) and run the following commands.
31+
Python version requirement: This workshop requires Python 3.11.9. Newer versions like 3.12 or 3.13 are not yet fully compatible with TensorFlow and may cause issues. Even Python 3.11.9 may have some edge cases, but it works well enough to be the default in Google Colab and is stable for the purposes of this workshop.
2632

27-
1. Create a [virtual environment](https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/#create-and-use-virtual-environments) called `dl_workshop`:
33+
To install Python 3.11.9, go to the [official 3.11.9 downloads page](https://www.python.org/downloads/release/python-3119//). Choose the installer that matches your operating system (Windows, macOS, or Linux).
2834

29-
::: spoiler
35+
Please set up your Python environment at least a day in advance of the workshop. If you run into issues with installation, contact the workshop organizers by email so you're ready to begin on time.
3036

31-
### On Linux/macOs
37+
38+
### Determine which `python` command to use for downstream setup steps
39+
40+
Different systems and Python installations (e.g., Anaconda, Git Bash, system Python, Windows Store, etc.) may register different command names. This quick check helps identify which one points to Python 3.11.9 on your machine.
41+
42+
Run the following in your terminal ([Git Bash recommended for Windows users](https://git-scm.com/downloads), Anaconda Prompt, or macOS/Linux shell):
3243

3344
```shell
34-
python3 -m venv dl_workshop
45+
python --version
46+
py --version
47+
python3 --version
3548
```
3649

37-
:::
50+
Use whichever one returns Python 3.11.9 for the rest of the setup steps.
3851

39-
::: spoiler
52+
Example output:
4053

41-
### On Windows
54+
```output
55+
$ python --version
56+
Python 3.11.9
57+
58+
$ py --version
59+
Python 3.13.2
60+
61+
$ python3 --version
62+
Python was not found...
63+
```
64+
In this case, use python throughout the remainder of the instructions.
65+
66+
If none of the commands return Python 3.11.9:
67+
68+
- Download and install Python 3.11.9. On Windows, be sure to check "Add Python to PATH" during installation
69+
- If you're on Windows using Anaconda Prompt, try using [Git Bash](https://git-scm.com/downloads) instead.
70+
- Then re-run the checks above in a new terminal window
71+
72+
If you're still stuck, ask the workshop organizers for help before proceeding.
73+
74+
## 3. Configure virtual environment
75+
76+
Open a terminal and run the following commands.
77+
78+
1. Create a [virtual environment](https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/#create-and-use-virtual-environments) called `venv` using the "venv" command:
4279

4380
```shell
44-
py -m venv dl_workshop
81+
# Use python3 or py instead if one of them points to 3.11.9.
82+
python -m venv venv # 1st "venv" is commmand, 2nd venv is name of the virtual environment / folder
4583
```
4684

47-
:::
85+
If you run the `ls` command from `~/Desktop/dl_workshop`, you should see a new `venv` folder inside it
86+
87+
```shell
88+
ls
89+
```
90+
91+
```output
92+
venv/
93+
```
4894

4995
2. Activate the newly created virtual environment:
5096

@@ -53,7 +99,7 @@ py -m venv dl_workshop
5399
### On Linux/macOs
54100

55101
```shell
56-
source dl_workshop/bin/activate
102+
source venv/bin/activate
57103
```
58104

59105
:::
@@ -63,20 +109,35 @@ source dl_workshop/bin/activate
63109
### On Windows
64110

65111
```shell
66-
dl_workshop\Scripts\activate
112+
venv\Scripts\activate
67113
```
68114

115+
If you're using Git Bash on Windows, you need to add the source command first.
116+
117+
```shell
118+
source venv/Scripts/activate
119+
```
69120
:::
70121

71-
Remember that you need to activate your environment every time you restart your terminal!
122+
**Note**: Remember that you need to activate your environment every time you restart your terminal, and before you launch Jupyter Lab!
123+
124+
3. After activating the enviornment, upgrade pip. This is a good practice to follow when you first initialize your virtual environment (beforing installing additional packages). [Pip](https://pip.pypa.io/en/stable/) is the package management system built into Python.Pip should be available in your system once you installed Python successfully.
125+
126+
```shell
127+
# remember: use python3 or py instead if it points to 3.11.9
128+
python -m pip install --upgrade pip
129+
```
72130

73-
3. Install the required packages:
131+
4. Install the required packages:
132+
133+
Follow the OS-specific instructions below. NOte that It may take 10-20 minutes to install everything.
74134

75135
::: spoiler
76136

77137
### On Linux/macOs
78138

79139
```shell
140+
# Use python or py instead if one of them points to 3.11.9.
80141
python3 -m pip install jupyter seaborn scikit-learn pandas tensorflow pydot
81142
```
82143

@@ -90,7 +151,8 @@ However, the installation is currently broken in the most recent version (as of
90151
### On Windows
91152

92153
```shell
93-
py -m pip install jupyter seaborn scikit-learn pandas tensorflow pydot
154+
# Use py or python3 instead if one of them points to 3.11.9.
155+
python -m pip install jupyter seaborn scikit-learn pandas tensorflow pydot
94156
```
95157

96158
:::
@@ -101,24 +163,34 @@ An [optional challenge in episode 2](episodes/2-keras.md) requires installation
101163
and instructions for doing that can be found
102164
[by following this link](https://graphviz.org/download/).
103165

104-
## Starting Jupyter Lab
166+
### Starting Jupyter Lab
105167

106168
We will teach using Python in [Jupyter Lab][jupyter], a programming environment that runs in a web browser.
107169
Jupyter Lab is compatible with Firefox, Chrome, Safari and Chromium-based browsers.
108170
Note that Internet Explorer and Edge are *not* supported.
109171
See the [Jupyter Lab documentation](https://jupyterlab.readthedocs.io/en/latest/getting_started/accessibility.html#compatibility-with-browsers-and-assistive-technology) for an up-to-date list of supported browsers.
110172

111173
To start Jupyter Lab, open a terminal (Mac/Linux) or Command Prompt (Windows),
112-
make sure that you activated the virtual environment you created for this course,
174+
**make sure that you activated the virtual environment you created for this course**,
113175
and type the command:
114176

115177
```shell
116178
jupyter lab
117179
```
118180

119-
## Check your setup
181+
### Check your virtual software setup
120182
To check whether all packages installed correctly, start a jupyter notebook in jupyter lab as
121-
explained above. Run the following lines of code:
183+
explained above (**with virtual environment activated**). Run the following check to verify you have the right version of Python configured.
184+
```python
185+
!python --version
186+
```
187+
188+
If you don't see 3.11.9, make sure your virtual environment was activated prior to launching Jupyter Lab.
189+
```output
190+
Python 3.11.9
191+
```
192+
193+
Then, run the following lines of code:
122194
```python
123195
import sklearn
124196
print('sklearn version: ', sklearn.__version__)
@@ -135,17 +207,43 @@ print('Tensorflow version: ', tensorflow.__version__)
135207

136208
This should output the versions of all required packages without giving errors.
137209
Most versions will work fine with this lesson, but:
210+
138211
- For Keras and Tensorflow, the minimum version is 2.12.0
139212
- For sklearn, the minimum version is 1.2.2
140213

141-
## Fallback option: cloud environment
214+
### Fallback option: cloud environment
142215
If a local installation does not work for you, it is also possible to run this lesson in [Binder Hub](https://mybinder.org/v2/gh/carpentries-incubator/deep-learning-intro/scaffolds). This should give you an environment with all the required software and data to run this lesson, nothing which is saved will be stored, please copy any files you want to keep. Note that if you are the first person to launch this in the last few days it can take several minutes to startup. The second person who loads it should find it loads in under a minute. Instructors who intend to use this option should start it themselves shortly before the workshop begins.
143216

144217
Alternatively you can use [Google colab](https://colab.research.google.com/). If you open a jupyter notebook here, the required packages are already pre-installed. Note that google colab uses jupyter notebook instead of Jupyter Lab.
145218

146-
## Downloading the required datasets
219+
## 4. Downloading the required datasets
220+
221+
Download the [weather dataset prediction csv][weatherdata] and [Dollar street dataset (4 files in total)][dollar-street]. Create a subfolder in your workshop folder called data, `~/Desktop/dl_workshop/data`, and move all 5 files to the data subfolder:
222+
223+
- `dl_workshop/data/weather_prediction_dataset_light.csv`
224+
- `dl_workshop/data/train_labels.npy`
225+
- `dl_workshop/data/test_labels.npy`
226+
- `dl_workshop/data/train_images.npy`
227+
- `dl_workshop/data/test_images.npy`
228+
229+
**Note**: If you end up using Google Colab for the workshop, you'll want to create a folder called `dl_workshop` within your Google drive, and then create the same `data` subfolder as above with all 5 files uploaded. **Avoid uploading the `venv` folder to your google drive**; you'll be using Colab's pre-built environment instead, and the `venv` folder contains MANY files from the libraries you installed.
230+
231+
You can access files from Google drive using Colab and the following code:
232+
233+
```python
234+
from google.colab import drive
235+
drive.mount('/content/drive')
236+
```
237+
238+
A prompt will appear asking you to authorize access to your Google Drive. After authorization, your Drive will be accessible under `/content/drive/My Drive/`. You can use standard Python I/O or libraries like pandas, os, glob, etc. to interact with files. Example below:
239+
240+
```python
241+
import pandas as pd
242+
# Load a CSV file from Drive
243+
df = pd.read_csv('/content/drive/My Drive/dl_workshop/data/weather_prediction_dataset_light.csv')
244+
```
147245

148-
Download the [weather dataset prediction csv][weatherdata] and [Dollar street dataset (4 files in total)][dollar-street]
246+
You can use the file navigator (folder icon) within Colab to help navigate your Google drive files.
149247

150248
[dollar-street]: https://zenodo.org/api/records/10970014/files-archive
151249
[jupyter]: http://jupyter.org/

0 commit comments

Comments
 (0)