You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can work on the assignment in one of two ways: locally on your own machine, or on a virtual machine on Google Cloud.
12
+
You can work on the assignment in one of two ways: **locally** on your own machine, or **remotely** on a Google Cloud virtual machine (VM).
9
13
10
-
### Working remotely on Google Cloud (Recommended)
14
+
### Working remotely on Google Cloud
15
+
As part of this course, you can use Google Cloud for your assignments. We recommend this route for anyone who is having trouble with installation set-up, or if you would like to use better CPU/GPU resources than you may have locally. Please see the set-up tutorial [here](https://github.com/cs231n/gcloud/) for more details.
11
16
12
-
**Note:** after following these instructions, you can skip the **Working locally** section.
17
+
**Note:** after following these instructions, you may skip the remaining sections.
13
18
14
-
As part of this course, you can use Google Cloud for your assignments. We recommend this route for anyone who is having trouble with installation set-up, or if you would like to use better CPU/GPU resources than you may have locally. Please see the set-up tutorial [here](https://github.com/cs231n/gcloud/) for more details. :)
19
+
### Working locally on your machine
20
+
If you wish to work locally, you should use a virtual environment. You can install one via Anaconda (recommended) or via Python's native `venv` module. Ensure you are using Python 3.7 as **we are no longer supporting Python 2**.
15
21
16
-
### Working locally
22
+
#### Anaconda virtual environment
23
+
We strongly recommend using the free [Anaconda Python distribution](https://www.anaconda.com/download/), which provides an easy way for you to handle package dependencies. Please be sure to download the Python 3 version, which currently installs Python 3.7. The neat thing about Anaconda is that it ships with [MKL optimizations](https://docs.anaconda.com/mkl-optimizations/) by default, which means your `numpy` and `scipy` code benefit from significant speed-ups without having to change a single line of code.
17
24
18
-
**Installing Anaconda:**
19
-
If you decide to work locally, we recommend using the free [Anaconda Python distribution](https://www.anaconda.com/download/), which provides an easy way for you to handle package dependencies. Please be sure to download the Python 3 version, which currently installs Python 3.7. We are no longer supporting Python 2.
25
+
Once you have Anaconda installed, it makes sense to create a virtual environment for the course. If you choose not to use a virtual environment (strongly not recommended!), it is up to you to make sure that all dependencies for the code are installed globally on your machine. To set up a virtual environment called `cs231n`, run the following in your terminal:
20
26
21
-
**Anaconda Virtual environment:**
22
-
Once you have Anaconda installed, it makes sense to create a virtual environment for the course. If you choose not to use a virtual environment, it is up to you to make sure that all dependencies for the code are installed globally on your machine. To set up a virtual environment, run (in a terminal)
23
-
24
-
`conda create -n cs231n python=3.7 anaconda`
27
+
```bash
28
+
conda create -n cs231n python=3.7
29
+
```
25
30
26
-
to create an environment called `cs231n`.
31
+
To activate and enter the environment, run `conda activate cs231n`. To deactivate the environment, either run `conda deactivate cs231n` or exit the terminal. Note that every time you want to work on the assignment, you should rerun `conda activate cs231n`.
27
32
28
-
Then, to activate and enter the environment, run
33
+
You may refer to [this page](https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html) for more detailed instructions on managing virtual environments with Anaconda.
29
34
30
-
`source activate cs231n`
35
+
**Note:** If you've chosen to go the Anaconda route, you can safely skip the next section and move straight to [Installing Packages](#installing-packages).
31
36
32
-
To exit, you can simply close the window, or run
37
+
<aname='venv'></a>
38
+
#### Python venv
33
39
34
-
`source deactivate cs231n`
40
+
As of 3.3, Python natively ships with a lightweight virtual environment module called [venv](https://docs.python.org/3/library/venv.html). Each virtual environment packages its own independent set of installed Python packages that are isolated from system-wide Python packages and runs a Python version that matches that of the binary that was used to create it. To set up your `cs231` venv for the course, run the following:
35
41
36
-
Note that every time you want to work on the assignment, you should run `source activate cs231n` (change to the name of your virtual env).
42
+
```bash
43
+
# create a virtual environment called cs231n
44
+
# that will use version 3.7 of Python
45
+
python3.7 -m venv cs231n
46
+
source cs231n/bin/activate # activate the virtual env
47
+
48
+
# sanity check that the path to the python
49
+
# binary matches that of the virtual env.
50
+
which python
51
+
# for example, on my machine, this prints
52
+
# $ '/Users/kevin/cs231n/bin/python'
53
+
```
37
54
38
-
You may refer to [this page](https://conda.io/docs/user-guide/tasks/manage-environments.html) for more detailed instructions on managing virtual environments with Anaconda.
55
+
<aname='packages'></a>
56
+
#### Installing packages
39
57
40
-
**Python virtualenv:**
41
-
Alternatively, you may use python [virtualenv](http://docs.python-guide.org/en/latest/dev/virtualenvs/) for the project. To set up a virtual environment, run the following:
58
+
Once you've **setup** and **activated** your virtual environment (via `conda` or `venv`), you should install the libraries needed to run the assignments using `pip`. To do so, run:
42
59
43
60
```bash
44
-
cd assignment1
45
-
sudo pip install virtualenv # This may already be installed
46
-
virtualenv -p python3 .env # Create a virtual environment (python3)
47
-
# Note: you can also use "virtualenv .env" to use your default python (please note we support 3.6)
48
-
source .env/bin/activate # Activate the virtual environment
0 commit comments