... | ... | @@ -23,27 +23,27 @@ For those of you using Jupyter notebooks (previously iPython notebooks), Paddle |
|
|
|
|
|
## How to Train Model With Paddle Book Docker Image
|
|
|
1. pull and run the docker image
|
|
|
```shell
|
|
|
# for CPU-only
|
|
|
docker run -it -v $HOME/.cache:/root/.cache --name xxx paddlepaddle/book:latest /bin/bash
|
|
|
# for GPU support
|
|
|
nvidia-docker run -it -v $HOME/.cache:/root/.cache --name xxx paddlepaddle/book:latest-gpu /bin/bash
|
|
|
```
|
|
|
```bash
|
|
|
# for CPU-only
|
|
|
docker run -it -v $HOME/.cache:/root/.cache --name xxx paddlepaddle/book:latest /bin/bash
|
|
|
# for GPU support
|
|
|
nvidia-docker run -it -v $HOME/.cache:/root/.cache --name xxx paddlepaddle/book:latest-gpu /bin/bash
|
|
|
```
|
|
|
- Use `--name xx` option to specify a name for your container, so when you leave. you can use `docker start xx` and `docker attach xx` to reenter it.
|
|
|
|
|
|
2. Navigate to the book chapter directory, such as `02.recognize_digits`
|
|
|
```shell
|
|
|
cd /book/02.recognize_digits/
|
|
|
```
|
|
|
```bash
|
|
|
cd /book/02.recognize_digits/
|
|
|
```
|
|
|
|
|
|
3. Run training process.
|
|
|
```shell
|
|
|
python train.py
|
|
|
```
|
|
|
```shell
|
|
|
python train.py
|
|
|
```
|
|
|
|
|
|
4. Save Model and copy model out of Docker container.
|
|
|
|
|
|
During training, the training process will save parameter to disk file like `params_pass_10.tar`, if you want to copy it out, you can copy it into `/root/.cache` and then get the model file in $HOME/.cache of the host machine.
|
|
|
During training, the training process will save parameter to disk file like `params_pass_10.tar`, if you want to copy it out, you can copy it into `/root/.cache` and then get the model file in $HOME/.cache of the host machine.
|
|
|
|
|
|
## How to use GPU resource on AWS
|
|
|
|
... | ... | |