download:Spring 5实战开发及新特性精讲
装置胜利后,我们在 python 环境中测试一下能否装置胜利(这个也是依照官网指引来做),我们切换到 python 环境,运转如下代码:
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 26 2018, 23:26:24) [Clang 6.0 (clang-600.0.57)] on darwinType "help", "copyright", "credits" or "license" for more information.>>> import paddle.fluid>>> paddle.fluid.install_check.run_check()Running Verify Paddle Program ... Your Paddle works well on SINGLE GPU or CPU.I0506 21:47:48.657404 2923565952 parallel_executor.cc:440] The Program will be executed on CPU using ParallelExecutor, 2 cards are used, so 2 programs are executed in parallel.W0506 21:47:48.658407 2923565952 fuse_all_reduce_op_pass.cc:74] Find all_reduce operators: 2. To make the speed faster, some all_reduce ops are fused during training, after fusion, the number of all_reduce ops is 1.I0506 21:47:48.658516 2923565952 build_strategy.cc:365] SeqOnlyAllReduceOps:0, num_trainers:1I0506 21:47:48.659137 2923565952 parallel_executor.cc:307] Inplace strategy is enabled, when build_strategy.enable_inplace = TrueI0506 21:47:48.659595 2923565952 parallel_executor.cc:375] Garbage collection strategy is enabled, when FLAGS_eager_delete_tensor_gb = 0Your Paddle works well on MUTIPLE GPU or CPU.Your Paddle is installed successfully! Let's start deep Learning with Paddle now>>>
看到 Your Paddle is installed successfully 就表示装置胜利了。
我们接下来需求运用的是这个平台的 paddlehub 工具,所以我们还需求装置 paddlehub :
装置完成后,我们就能够开端运用了。
代码完成
我们的完成步骤很简单:导入模块 -> 加载模型 -> 获取图片文件 -> 调用模块抠图。