提交 bcafb32a 编写于 作者: W weixing02

fix error

上级 2c589f7c
...@@ -11,7 +11,7 @@ PaddlePaddle支持使用pip快速安装,目前支持CentOS 6以上, Ubuntu 14. ...@@ -11,7 +11,7 @@ PaddlePaddle支持使用pip快速安装,目前支持CentOS 6以上, Ubuntu 14.
pip install paddlepaddle pip install paddlepaddle
如果需要安装支持GPU的版本(cuda7.5_cudnn5_avx_openblas),需要执行: 如果需要安装支持GPU的版本(cuda8.0_cudnn5_avx_openblas),需要执行:
.. code-block:: bash .. code-block:: bash
...@@ -28,18 +28,18 @@ PaddlePaddle支持使用pip快速安装,目前支持CentOS 6以上, Ubuntu 14. ...@@ -28,18 +28,18 @@ PaddlePaddle支持使用pip快速安装,目前支持CentOS 6以上, Ubuntu 14.
import paddle.dataset.uci_housing as uci_housing import paddle.dataset.uci_housing as uci_housing
import paddle.fluid as fluid import paddle.fluid as fluid
with fluid.scope_guard(fluid.core.Scope()): with fluid.scope_guard(fluid.core.Scope()):
# initialize executor with cpu # initialize executor with cpu
exe = fluid.Executor(place=fluid.CPUPlace()) exe = fluid.Executor(place=fluid.CPUPlace())
# load inference model # load inference model
[inference_program, feed_target_names,fetch_targets] = \ [inference_program, feed_target_names,fetch_targets] = \
fluid.io.load_inference_model(uci_housing.fluid_model(), exe) fluid.io.load_inference_model(uci_housing.fluid_model(), exe)
# run inference # run inference
result = exe.run(inference_program, result = exe.run(inference_program,
feed={feed_target_names[0]: uci_housing.predict_reader()}, feed={feed_target_names[0]: uci_housing.predict_reader()},
fetch_list=fetch_targets) fetch_list=fetch_targets)
# print predicted price is $12,273.97 # print predicted price is $12,273.97
print 'Predicted price: ${:,.2f}'.format(result[0][0][0] * 1000) print 'Predicted price: ${:,.2f}'.format(result[0][0][0] * 1000)
执行 :code:`python housing.py` 瞧! 它应该打印出预测住房数据的清单。 执行 :code:`python housing.py` 瞧! 它应该打印出预测住房数据的清单。
...@@ -12,7 +12,7 @@ Simply run the following command to install, the version is cpu_avx_openblas: ...@@ -12,7 +12,7 @@ Simply run the following command to install, the version is cpu_avx_openblas:
pip install paddlepaddle pip install paddlepaddle
If you need to install GPU version (cuda7.5_cudnn5_avx_openblas), run: If you need to install GPU version (cuda8.0_cudnn5_avx_openblas), run:
.. code-block:: bash .. code-block:: bash
...@@ -31,18 +31,18 @@ code: ...@@ -31,18 +31,18 @@ code:
import paddle.dataset.uci_housing as uci_housing import paddle.dataset.uci_housing as uci_housing
import paddle.fluid as fluid import paddle.fluid as fluid
with fluid.scope_guard(fluid.core.Scope()): with fluid.scope_guard(fluid.core.Scope()):
# initialize executor with cpu # initialize executor with cpu
exe = fluid.Executor(place=fluid.CPUPlace()) exe = fluid.Executor(place=fluid.CPUPlace())
# load inference model # load inference model
[inference_program, feed_target_names,fetch_targets] = \ [inference_program, feed_target_names,fetch_targets] = \
fluid.io.load_inference_model(uci_housing.fluid_model(), exe) fluid.io.load_inference_model(uci_housing.fluid_model(), exe)
# run inference # run inference
result = exe.run(inference_program, result = exe.run(inference_program,
feed={feed_target_names[0]: uci_housing.predict_reader()}, feed={feed_target_names[0]: uci_housing.predict_reader()},
fetch_list=fetch_targets) fetch_list=fetch_targets)
# print predicted price is $12,273.97 # print predicted price is $12,273.97
print 'Predicted price: ${:,.2f}'.format(result[0][0][0] * 1000) print 'Predicted price: ${:,.2f}'.format(result[0][0][0] * 1000)
Run :code:`python housing.py` and voila! It should print out a list of predictions Run :code:`python housing.py` and voila! It should print out a list of predictions
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册