提交 7c2d32b8 编写于 作者: T typhoonzero

update dockerfile

上级 b7fbb91f
FROM python:2.7.14 FROM python:2.7.14
ADD https://raw.githubusercontent.com/PaddlePaddle/cloud/develop/docker/paddle_k8s /usr/bin RUN pip install -U kubernetes opencv-python && apt-get update -y && apt-get install -y iputils-ping libgtk2.0-dev
ADD https://raw.githubusercontent.com/PaddlePaddle/cloud/develop/docker/k8s_tools.py /root
RUN pip install -U kubernetes opencv-python && apt-get update -y && apt-get install -y iputils-ping libgtk2.0-dev && \
chmod +x /usr/bin/paddle_k8s
# NOTE: By default CI built wheel packages turn WITH_DISTRIBUTE=OFF, # NOTE: By default CI built wheel packages turn WITH_DISTRIBUTE=OFF,
# so we must build one with distribute support to install in this image. # so we must build one with distribute support to install in this image.
ADD *.whl / RUN pip install paddlepaddle
RUN pip install /*.whl && rm -f /*.whl
ENV LD_LIBRARY_PATH=/usr/local/lib
RUN sh -c 'echo "import paddle.v2 as paddle\npaddle.dataset.cifar.train10()" | python' RUN sh -c 'echo "import paddle.v2 as paddle\npaddle.dataset.cifar.train10()" | python'
RUN pip uninstall -y paddlepaddle
# below lines may change a lot for debugging
ADD https://raw.githubusercontent.com/PaddlePaddle/cloud/develop/docker/paddle_k8s /usr/bin
ADD https://raw.githubusercontent.com/PaddlePaddle/cloud/develop/docker/k8s_tools.py /root
ADD *.whl /
RUN pip install /*.whl && rm -f /*.whl && \
chmod +x /usr/bin/paddle_k8s
ENV LD_LIBRARY_PATH=/usr/local/lib
ADD vgg16_fluid.py vgg16_v2.py /workspace/ ADD vgg16_fluid.py vgg16_v2.py /workspace/
...@@ -40,13 +40,13 @@ ...@@ -40,13 +40,13 @@
- Batch Size: 128 - Batch Size: 128
- Metrics: samples / sec - Metrics: samples / sec
| Trainer Counter | 20 | 40 | 80 | 100 | | Trainer Count | 20 | 40 | 80 | 100 |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- | -- |
| PaddlePaddle Fluid | 263.29 (78.64%) | 518.80 (77.47%) | 836.26 (62.44%) | 1019.29 (60.89%) | | PaddlePaddle Fluid | 263.29 (78.64%) | 518.80 (77.47%) | 836.26 (62.44%) | 1019.29 (60.89%) |
| PaddlePaddle v2 (need more tests) | 326.85 (92.85%) | 534.58 (75.93%) | 853.30 (60.60%) | 1041.99 (59.20%) | | PaddlePaddle v2 (need more tests) | 326.85 (92.85%) | 534.58 (75.93%) | 853.30 (60.60%) | 1041.99 (59.20%) |
| TensorFlow | - | - | - | - | | TensorFlow | - | - | - | - |
### Different Pserver Number ### Different Pserver Count
- Trainer Count: 100 - Trainer Count: 100
- Batch Size: 128 - Batch Size: 128
......
...@@ -50,6 +50,11 @@ parser.add_argument( ...@@ -50,6 +50,11 @@ parser.add_argument(
default='CPU', default='CPU',
choices=['CPU', 'GPU'], choices=['CPU', 'GPU'],
help="The device type.") help="The device type.")
parser.add_argument(
'--device_id',
type=int,
default=0,
help="The device id.")
parser.add_argument( parser.add_argument(
'--data_format', '--data_format',
type=str, type=str,
...@@ -135,7 +140,7 @@ def main(): ...@@ -135,7 +140,7 @@ def main():
optimize_ops, params_grads = optimizer.minimize(avg_cost) optimize_ops, params_grads = optimizer.minimize(avg_cost)
# Initialize executor # Initialize executor
place = core.CPUPlace() if args.device == 'CPU' else core.CUDAPlace(0) place = core.CPUPlace() if args.device == 'CPU' else core.CUDAPlace(args.device_id)
exe = fluid.Executor(place) exe = fluid.Executor(place)
# test # test
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册