From 36761f03f193303bfa50c774db87ed356026f49c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Geron?= Date: Tue, 21 Dec 2021 11:35:26 +1300 Subject: [PATCH] Change environment name from tf2 to homl3 --- INSTALL.md | 16 ++++++++-------- README.md | 2 +- docker/Dockerfile | 2 +- docker/Dockerfile.gpu | 2 +- docker/README.md | 2 +- docker/docker-compose.yml | 4 ++-- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 8494905..05dadb3 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -28,18 +28,18 @@ Once Anaconda (or Miniconda) is installed, run the following command to update t ## Install the GPU Driver and Libraries If you have a TensorFlow-compatible GPU card (NVidia card with Compute Capability ≥ 3.5), and you want TensorFlow to use it, then you should download the latest driver for your card from [nvidia.com](https://www.nvidia.com/Download/index.aspx?lang=en-us) and install it. You will also need NVidia's CUDA and cuDNN libraries, but the good news is that they will be installed automatically when you install the tensorflow-gpu package from Anaconda. However, if you don't use Anaconda, you will have to install them manually. If you hit any roadblock, see TensorFlow's [GPU installation instructions](https://tensorflow.org/install/gpu) for more details. -## Create the `tf2` Environment -Next, make sure you're in the `handson-ml3` directory and run the following command. It will create a new `conda` environment containing every library you will need to run all the notebooks (by default, the environment will be named `tf2`, but you can choose another name using the `-n` option): +## Create the `homl3` Environment +Next, make sure you're in the `handson-ml3` directory and run the following command. It will create a new `conda` environment containing every library you will need to run all the notebooks (by default, the environment will be named `homl3`, but you can choose another name using the `-n` option): $ conda env create -f environment.yml Next, activate the new environment: - $ conda activate tf2 + $ conda activate homl3 ## Start Jupyter -You're almost there! You just need to register the `tf2` conda environment to Jupyter. The notebooks in this project will default to the environment named `python3`, so it's best to register this environment using the name `python3` (if you prefer to use another name, you will have to select it in the "Kernel > Change kernel..." menu in Jupyter every time you open a notebook): +You're almost there! You just need to register the `homl3` conda environment to Jupyter. The notebooks in this project will default to the environment named `python3`, so it's best to register this environment using the name `python3` (if you prefer to use another name, you will have to select it in the "Kernel > Change kernel..." menu in Jupyter every time you open a notebook): $ python3 -m ipykernel install --user --name=python3 @@ -55,7 +55,7 @@ When you're done with Jupyter, you can close it by typing Ctrl-C in the Terminal $ cd $HOME # or whatever development directory you chose earlier $ cd handson-ml3 - $ conda activate tf2 + $ conda activate homl3 $ jupyter notebook ## Update This Project and its Libraries @@ -79,10 +79,10 @@ Next, let's update the libraries. First, let's update `conda` itself: $ conda update -c defaults -n base conda -Then we'll delete this project's `tf2` environment: +Then we'll delete this project's `homl3` environment: $ conda activate base - $ conda env remove -n tf2 + $ conda env remove -n homl3 And recreate the environment: @@ -90,5 +90,5 @@ And recreate the environment: Lastly, we reactivate the environment and start Jupyter: - $ conda activate tf2 + $ conda activate homl3 $ jupyter notebook diff --git a/README.md b/README.md index 09af444..5649580 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ Next, clone this project by opening a terminal and typing the following commands Next, run the following commands: $ conda env create -f environment.yml - $ conda activate tf2 + $ conda activate homl3 $ python -m ipykernel install --user --name=python3 Finally, start Jupyter: diff --git a/docker/Dockerfile b/docker/Dockerfile index abde6cb..9d045ff 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -43,7 +43,7 @@ RUN chown ${username}:${username} ${workdir} USER ${username} WORKDIR ${workdir} -ENV PATH /opt/conda/envs/tf2/bin:$PATH +ENV PATH /opt/conda/envs/homl3/bin:$PATH # The config below enables diffing notebooks with nbdiff (and nbdiff support # in git diff command) after connecting to the container by "make exec" (or diff --git a/docker/Dockerfile.gpu b/docker/Dockerfile.gpu index 4c8c62e..71bb42a 100644 --- a/docker/Dockerfile.gpu +++ b/docker/Dockerfile.gpu @@ -94,7 +94,7 @@ RUN ln -s /usr/local/cuda/lib64/stubs/libcuda.so /usr/local/cuda/lib64/stubs/lib ################################################# ENV LANG=C.UTF-8 LC_ALL=C.UTF-8 -ENV PATH /opt/conda/bin:/opt/conda/envs/tf2/bin:$PATH +ENV PATH /opt/conda/bin:/opt/conda/envs/homl3/bin:$PATH # Next we need to install miniconda diff --git a/docker/README.md b/docker/README.md index 522cdd7..d209de1 100644 --- a/docker/README.md +++ b/docker/README.md @@ -133,7 +133,7 @@ If you are using Docker 19.03 or above, you can run: ```bash $ cd /path/to/project/handson-ml3 -$ docker run --name handson-ml3 --gpus all -p 8888:8888 -p 6006:6006 --log-opt mode=non-blocking --log-opt max-buffer-size=50m -v `pwd`:/home/devel/handson-ml3 ageron/handson-ml3:latest-gpu /opt/conda/envs/tf2/bin/jupyter notebook --ip='0.0.0.0' --port=8888 --no-browser +$ docker run --name handson-ml3 --gpus all -p 8888:8888 -p 6006:6006 --log-opt mode=non-blocking --log-opt max-buffer-size=50m -v `pwd`:/home/devel/handson-ml3 ageron/handson-ml3:latest-gpu /opt/conda/envs/homl3/bin/jupyter notebook --ip='0.0.0.0' --port=8888 --no-browser ``` If you are using an older version of Docker, then replace `--gpus all` with `--runtime=nvidia`. diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index f5cae59..b862218 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -19,9 +19,9 @@ services: - "6006:6006" volumes: - ../:/home/devel/handson-ml3 - command: /opt/conda/envs/tf2/bin/jupyter notebook --ip='0.0.0.0' --port=8888 --no-browser + command: /opt/conda/envs/homl3/bin/jupyter notebook --ip='0.0.0.0' --port=8888 --no-browser #deploy: # resources: # reservations: # devices: - # - capabilities: [gpu] \ No newline at end of file + # - capabilities: [gpu]