提交 e6e8bc40 编写于 作者: L lujun

update docker hub;fix plot bug, test=develop

上级 6c782c88
...@@ -223,16 +223,16 @@ for pass_id in range(num_epochs): ...@@ -223,16 +223,16 @@ for pass_id in range(num_epochs):
feed=feeder.feed(data_train), feed=feeder.feed(data_train),
fetch_list=[avg_loss]) fetch_list=[avg_loss])
if step % 10 == 0: # record a train cost every 10 batches if step % 10 == 0: # record a train cost every 10 batches
plot_cost.append(train_prompt, step, avg_loss_value[0]) plot_prompt.append(train_prompt, step, avg_loss_value[0])
plot_cost.plot() plot_prompt.plot()
if step % 100 == 0: # record a test cost every 100 batches if step % 100 == 0: # record a test cost every 100 batches
test_metics = train_test(executor=exe_test, test_metics = train_test(executor=exe_test,
program=test_program, program=test_program,
reader=test_reader, reader=test_reader,
fetch_list=[avg_loss.name], fetch_list=[avg_loss.name],
feeder=feeder) feeder=feeder)
plot_cost.append(test_prompt, step, test_metics[0]) plot_prompt.append(test_prompt, step, test_metics[0])
plot_cost.plot() plot_prompt.plot()
# If the accuracy is good enough, we can stop the training. # If the accuracy is good enough, we can stop the training.
if test_metics[0] < 10.0: if test_metics[0] < 10.0:
break break
......
...@@ -265,16 +265,16 @@ for pass_id in range(num_epochs): ...@@ -265,16 +265,16 @@ for pass_id in range(num_epochs):
feed=feeder.feed(data_train), feed=feeder.feed(data_train),
fetch_list=[avg_loss]) fetch_list=[avg_loss])
if step % 10 == 0: # record a train cost every 10 batches if step % 10 == 0: # record a train cost every 10 batches
plot_cost.append(train_prompt, step, avg_loss_value[0]) plot_prompt.append(train_prompt, step, avg_loss_value[0])
plot_cost.plot() plot_prompt.plot()
if step % 100 == 0: # record a test cost every 100 batches if step % 100 == 0: # record a test cost every 100 batches
test_metics = train_test(executor=exe_test, test_metics = train_test(executor=exe_test,
program=test_program, program=test_program,
reader=test_reader, reader=test_reader,
fetch_list=[avg_loss.name], fetch_list=[avg_loss.name],
feeder=feeder) feeder=feeder)
plot_cost.append(test_prompt, step, test_metics[0]) plot_prompt.append(test_prompt, step, test_metics[0])
plot_cost.plot() plot_prompt.plot()
# If the accuracy is good enough, we can stop the training. # If the accuracy is good enough, we can stop the training.
if test_metics[0] < 10.0: if test_metics[0] < 10.0:
break break
......
...@@ -29,10 +29,10 @@ docker run -d -p 8888:8888 paddlepaddle/book ...@@ -29,10 +29,10 @@ docker run -d -p 8888:8888 paddlepaddle/book
会从DockerHub.com下载和运行本书的Docker image。阅读和在线编辑本书请在浏览器里访问 http://localhost:8888 。 会从DockerHub.com下载和运行本书的Docker image。阅读和在线编辑本书请在浏览器里访问 http://localhost:8888 。
如果您访问DockerHub.com很慢,可以试试我们的另一个镜像docker.paddlepaddlehub.com: 如果您访问DockerHub.com很慢,可以试试我们的另一个镜像hub.baidubce.com:
```bash ```bash
docker run -d -p 8888:8888 docker.paddlepaddlehub.com/book docker run -d -p 8888:8888 hub.baidubce.com/paddlepaddle/book
``` ```
### 使用GPU训练 ### 使用GPU训练
...@@ -46,7 +46,7 @@ nvidia-docker run -d -p 8888:8888 paddlepaddle/book:latest-gpu ...@@ -46,7 +46,7 @@ nvidia-docker run -d -p 8888:8888 paddlepaddle/book:latest-gpu
或者使用国内的镜像请运行: 或者使用国内的镜像请运行:
```bash ```bash
nvidia-docker run -d -p 8888:8888 docker.paddlepaddlehub.com/book:latest-gpu nvidia-docker run -d -p 8888:8888 hub.baidubce.com/paddlepaddle/book:latest-gpu
``` ```
还需要将以下代码 还需要将以下代码
......
...@@ -28,10 +28,10 @@ docker run -d -p 8888:8888 paddlepaddle/book ...@@ -28,10 +28,10 @@ docker run -d -p 8888:8888 paddlepaddle/book
This command will download the pre-built Docker image from DockerHub.com and run it in a container. Please direct your Web browser to http://localhost:8888 to read the book. This command will download the pre-built Docker image from DockerHub.com and run it in a container. Please direct your Web browser to http://localhost:8888 to read the book.
If you are living in somewhere slow to access DockerHub.com, you might try our mirror server docker.paddlepaddlehub.com: If you are living in somewhere slow to access DockerHub.com, you might try our mirror server hub.baidubce.com:
```bash ```bash
docker run -d -p 8888:8888 docker.paddlepaddlehub.com/book docker run -d -p 8888:8888 hub.baidubce.com/paddlepaddle/book
``` ```
...@@ -49,7 +49,7 @@ nvidia-docker run -d -p 8888:8888 paddlepaddle/book:latest-gpu ...@@ -49,7 +49,7 @@ nvidia-docker run -d -p 8888:8888 paddlepaddle/book:latest-gpu
Or you can use the image registry mirror in China: Or you can use the image registry mirror in China:
```bash ```bash
nvidia-docker run -d -p 8888:8888 docker.paddlepaddlehub.com/book:latest-gpu nvidia-docker run -d -p 8888:8888 hub.baidubce.com/paddlepaddle/book:latest-gpu
``` ```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册