{"id":25791,"date":"2020-05-15T00:29:44","date_gmt":"2020-05-14T16:29:44","guid":{"rendered":"http:\/\/www.zhushiyao.com\/?p=25791"},"modified":"2020-05-15T00:31:02","modified_gmt":"2020-05-14T16:31:02","slug":"a4433e945b","status":"publish","type":"post","link":"http:\/\/www.zhushiyao.com\/?p=25791","title":{"rendered":"Python\u88c5\u903c\u6307\u5357\u2014\u2014\u4e94\u884c\u4ee3\u7801\u5b9e\u73b0\u6279\u91cf\u62a0\u56fe"},"content":{"rendered":"<div class=\"bpp-post-content\">\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"rich_pages\" style=\"box-sizing: border-box !important; width: 677px !important; visibility: visible !important;\" title=\"Python\u88c5\u903c\u6307\u5357\u2014\u2014\u4e94\u884c\u4ee3\u7801\u5b9e\u73b0\u6279\u91cf\u62a0\u56fe\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2020\/05\/1-1589473785.jpeg\" alt=\"Python\u88c5\u903c\u6307\u5357\u2014\u2014\u4e94\u884c\u4ee3\u7801\u5b9e\u73b0\u6279\u91cf\u62a0\u56fe\" \/><\/p>\n<p style=\"margin-right: 16px; margin-left: 16px; color: #595959; font-size: 15px; caret-color: #333333; letter-spacing: 0.544px; text-size-adjust: auto; text-align: center; line-height: 1.75em;\"><span style=\"color: #888888; font-size: 14px;\"><span style=\"font-family: \u5fae\u8f6f\u96c5\u9ed1; letter-spacing: 1px; widows: 1;\">\u6587 |<\/span><span style=\"font-family: \u5fae\u8f6f\u96c5\u9ed1; letter-spacing: 1px; widows: 1;\">\u00a0\u95f2\u6b22<\/span><br \/><\/span><\/p>\n<p style=\"margin-right: 16px; margin-left: 16px; color: #595959; font-size: 15px; caret-color: #333333; letter-spacing: 0.544px; text-size-adjust: auto; text-align: center; line-height: 1.75em;\"><span style=\"font-family: \u5fae\u8f6f\u96c5\u9ed1; font-size: 13px; letter-spacing: 1px; widows: 1; color: #888888;\">\u6765\u6e90\uff1aPython \u6280\u672f\u300cID: pythonall\u300d<\/span><\/p>\n<p style=\"margin-right: 16px; margin-left: 16px; color: #595959; font-size: 15px; caret-color: #333333; letter-spacing: 0.544px; text-size-adjust: auto; text-align: center; line-height: 1.75em;\"><img decoding=\"async\" style=\"letter-spacing: 0.544px; text-align: justify; font-size: 13px; display: inline; box-sizing: border-box !important; visibility: visible !important; width: 574px !important;\" title=\"Python\u88c5\u903c\u6307\u5357\u2014\u2014\u4e94\u884c\u4ee3\u7801\u5b9e\u73b0\u6279\u91cf\u62a0\u56fe\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2020\/05\/10-1589473785.jpeg\" alt=\"Python\u88c5\u903c\u6307\u5357\u2014\u2014\u4e94\u884c\u4ee3\u7801\u5b9e\u73b0\u6279\u91cf\u62a0\u56fe\" width=\"84%\" \/><\/p>\n<p style=\"margin: 1em 4px; padding-top: 8px; padding-bottom: 8px; font-size: 16px; line-height: 26px; color: black; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; letter-spacing: 0.75px; text-align: left;\">\u4f60\u662f\u5426\u66fe\u7ecf\u60f3\u5c06\u67d0\u5f20\u7167\u7247\u4e2d\u7684\u4eba\u7269\u62a0\u51fa\u6765\uff0c\u7136\u540e\u62fc\u63a5\u5230\u5176\u4ed6\u56fe\u7247\u4e0a\u53bb\uff0c\u4ece\u800c\u53ef\u4ee5\u5373\u4f7f\u4f60\u5728\u5929\u6daf\u6d77\u89d2\uff0c\u6211\u4e5f\u53ef\u4ee5\u5230\u6b64\u4e00\u6e38\uff1f\u4e13\u4e1a\u70b9\u7684\u4eba\u4f7f\u7528 PhotoShop \u7684\u201c\u9b54\u68d2\u201d\u5de5\u5177\u53ef\u4ee5\u62a0\u56fe\uff0c\u975e\u4e13\u4e1a\u4eba\u58eb\u53ef\u4ee5\u4f7f\u7528\u5404\u79cd\u7f8e\u56fe APP \u6765\u5b9e\u73b0\uff0c\u4f46\u662f\u4ed6\u4eec\u6bd5\u7adf\u5904\u7406\u80fd\u529b\u6709\u9650\uff0c\u4e00\u6b21\u53ea\u80fd\u5904\u7406\u4e00\u5f20\u56fe\u7247\uff0c\u800c\u4e14\u6bd4\u8f83\u590d\u6742\u7684\u56fe\u50cf\u53ef\u80fd\u8017\u65f6\u8f83\u4e45\u3002\u4eca\u5929\u6211\u6765\u5411\u5927\u5bb6\u5c55\u793a\u7b2c\u4e09\u79cd\u9014\u5f84\u2014\u2014\u7528 Python \u4e00\u952e\u6279\u91cf\u62a0\u56fe\u3002<\/p>\n<h2 style=\"margin-top: 1em; margin-bottom: 0rem; padding-top: 0.5em; padding-bottom: 0.5em; font-weight: bold; font-size: 23px; color: #35b378; line-height: 32px; display: inline-block; border-bottom: 0px solid #35b378; border-top-color: #35b378; border-right-color: #35b378; border-left-color: #35b378; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; letter-spacing: 0.75px; text-align: left;\">\u51c6\u5907\u5de5\u4f5c<\/h2>\n<p>\u00a0<\/p>\n<p style=\"margin: 1em 4px; padding-top: 8px; padding-bottom: 8px; font-size: 16px; line-height: 26px; color: black; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; letter-spacing: 0.75px; text-align: left;\">\u65e2\u7136\u8981\u88c5\u903c\uff0c\u51c6\u5907\u5de5\u4f5c\u662f\u5c11\u4e0d\u4e86\u7684\u3002\u6240\u8c13\u201c\u7ad9\u5728\u5de8\u4eba\u7684\u80a9\u8180\u4e0a\uff0c\u505a\u4e8b\u4e8b\u534a\u529f\u500d\u201d\uff0c\u6211\u4eec\u8fd9\u91cc\u7684\u201c\u5de8\u4eba\u201d\u5c31\u662f paddlepaddle \u4e86\uff0c\u4e2d\u6587\u540d\u79f0\u53eb\u201c\u98de\u6868\u201d\uff0c\u90a3\u4e48\u8fd9\u4e2a paddlepaddle \u662f\u4ec0\u4e48\u5462\uff1f<\/p>\n<p style=\"margin: 1em 4px; padding-top: 8px; padding-bottom: 8px; font-size: 16px; line-height: 26px; color: black; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; letter-spacing: 0.75px; text-align: left;\">\u5b83\u662f\u201c\u6e90\u4e8e\u4ea7\u4e1a\u5b9e\u8df5\u7684\u5f00\u6e90\u6df1\u5ea6\u5b66\u4e60\u5e73\u53f0\uff0c\u81f4\u529b\u4e8e\u8ba9\u6df1\u5ea6\u5b66\u4e60\u6280\u672f\u7684\u521b\u65b0\u4e0e\u5e94\u7528\u66f4\u7b80\u5355\u201d\uff0c\u76f4\u767d\u70b9\u5c31\u662f\u6211\u5e2e\u4f60\u5b9e\u73b0\u4e86\u6df1\u5ea6\u5b66\u4e60\u5e95\u5c42\u6846\u67b6\uff0c\u4f60\u53ea\u8981\u6709\u521b\u610f\u5c31\u53ef\u4ee5\u5728\u6211\u5e73\u53f0\u4e0a\u8fd0\u7528\u5c11\u91cf\u7b80\u5355\u4ee3\u7801\u8f7b\u677e\u5b9e\u73b0\u3002\u5b83\u7684\u5b98\u7f51\u662f https:\/\/www.paddlepaddle.org.cn\/ \u3002<\/p>\n<p style=\"margin: 1em 4px; padding-top: 8px; padding-bottom: 8px; font-size: 16px; line-height: 26px; color: black; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; letter-spacing: 0.75px; text-align: left;\">\u5b83\u7684\u5b89\u88c5\u4e5f\u6bd4\u8f83\u7b80\u5355\uff0c\u5b98\u7f51\u9996\u9875\u5c31\u6709\u5b89\u88c5\u6307\u5f15\uff0c\u6211\u4eec\u8fd9\u91cc\u6839\u636e\u5b98\u7f51\u7684\u5b89\u88c5\u6307\u5f15\uff0c\u4f7f\u7528 pip \u65b9\u5f0f\u6765\u5b89\u88c5 CPU \u7248\u672c\u3002<\/p>\n<p style=\"margin: 1em 4px; padding-top: 8px; padding-bottom: 8px; font-size: 16px; line-height: 26px; color: black; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; letter-spacing: 0.75px; text-align: left;\">\u6211\u4eec\u9996\u5148\u6267\u884c\u8bed\u53e5\uff1a<\/p>\n<blockquote style=\"margin: 10px 5px; padding: 10px 10px 10px 20px; border-left-color: #35b378; color: #616161; font-size: 0.9em; overflow: auto; background: #fbf9fd; border-right: 0px solid #35b378; quotes: none; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; letter-spacing: 0.75px; text-align: left;\">\n<p style=\"padding-top: 8px; padding-bottom: 8px; font-size: 16px; line-height: 26px; color: black;\">python -m pip install paddlepaddle -i https:\/\/mirror.baidu.com\/pypi\/simple<\/p>\n<\/blockquote>\n<p style=\"margin: 1em 4px; padding-top: 8px; padding-bottom: 8px; font-size: 16px; line-height: 26px; color: black; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; letter-spacing: 0.75px; text-align: left;\">\u5b89\u88c5\u6210\u529f\u540e\uff0c\u6211\u4eec\u5728 python \u73af\u5883\u4e2d\u6d4b\u8bd5\u4e00\u4e0b\u662f\u5426\u5b89\u88c5\u6210\u529f\uff08\u8fd9\u4e2a\u4e5f\u662f\u6309\u7167\u5b98\u7f51\u6307\u5f15\u6765\u505a\uff09\uff0c\u6211\u4eec\u5207\u6362\u5230 python \u73af\u5883\uff0c\u8fd0\u884c\u5982\u4e0b\u4ee3\u7801\uff1a<\/p>\n<pre style=\"margin-top: 10px; margin-bottom: 10px; font-size: 15px; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; overflow: auto; color: #595959; letter-spacing: 0.75px; text-align: left;\"><code style=\"padding: 16px; font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; font-size: 12px; display: -webkit-box; overflow-x: auto; color: #abb2bf; background: #282c34; border-radius: 0px;\">Python\u00a0<span style=\"color: #d19a66; line-height: 26px;\">3.7<\/span><span style=\"color: #d19a66; line-height: 26px;\">.0<\/span>\u00a0(v3<span style=\"color: #d19a66; line-height: 26px;\">.7<\/span><span style=\"color: #d19a66; line-height: 26px;\">.0<\/span>:<span style=\"color: #d19a66; line-height: 26px;\">1<\/span>bf9cc5093,\u00a0Jun\u00a0<span style=\"color: #d19a66; line-height: 26px;\">26<\/span>\u00a0<span style=\"color: #d19a66; line-height: 26px;\">2018<\/span>,\u00a0<span style=\"color: #d19a66; line-height: 26px;\">23<\/span>:<span style=\"color: #d19a66; line-height: 26px;\">26<\/span>:<span style=\"color: #d19a66; line-height: 26px;\">24<\/span>)\u00a0<br \/>[Clang\u00a0<span style=\"color: #d19a66; line-height: 26px;\">6.0<\/span>\u00a0(clang<span style=\"color: #d19a66; line-height: 26px;\">-600.0<\/span><span style=\"color: #d19a66; line-height: 26px;\">.57<\/span>)]\u00a0on\u00a0darwin<br \/>Type\u00a0<span style=\"color: #98c379; line-height: 26px;\">\"help\"<\/span>,\u00a0<span style=\"color: #98c379; line-height: 26px;\">\"copyright\"<\/span>,\u00a0<span style=\"color: #98c379; line-height: 26px;\">\"credits\"<\/span>\u00a0<span style=\"color: #c678dd; line-height: 26px;\">or<\/span>\u00a0<span style=\"color: #98c379; line-height: 26px;\">\"license\"<\/span>\u00a0<span style=\"color: #c678dd; line-height: 26px;\">for<\/span>\u00a0more\u00a0information.<br \/><span style=\"color: #61aeee; line-height: 26px;\">&gt;&gt;&gt;\u00a0<\/span><span style=\"color: #c678dd; line-height: 26px;\">import<\/span>\u00a0paddle.fluid<br \/><span style=\"color: #61aeee; line-height: 26px;\">&gt;&gt;&gt;\u00a0<\/span>paddle.fluid.install_check.run_check()<br \/>Running\u00a0Verify\u00a0Paddle\u00a0Program\u00a0...\u00a0<br \/>Your\u00a0Paddle\u00a0works\u00a0well\u00a0on\u00a0SINGLE\u00a0GPU\u00a0<span style=\"color: #c678dd; line-height: 26px;\">or<\/span>\u00a0CPU.<br \/>I0506\u00a0<span style=\"color: #d19a66; line-height: 26px;\">21<\/span>:<span style=\"color: #d19a66; line-height: 26px;\">47<\/span>:<span style=\"color: #d19a66; line-height: 26px;\">48.657404<\/span>\u00a0<span style=\"color: #d19a66; line-height: 26px;\">2923565952<\/span>\u00a0parallel_executor.cc:<span style=\"color: #d19a66; line-height: 26px;\">440<\/span>]\u00a0The\u00a0Program\u00a0will\u00a0be\u00a0executed\u00a0on\u00a0CPU\u00a0using\u00a0ParallelExecutor,\u00a0<span style=\"color: #d19a66; line-height: 26px;\">2<\/span>\u00a0cards\u00a0are\u00a0used,\u00a0so\u00a0<span style=\"color: #d19a66; line-height: 26px;\">2<\/span>\u00a0programs\u00a0are\u00a0executed\u00a0<span style=\"color: #c678dd; line-height: 26px;\">in<\/span>\u00a0parallel.<br \/>W0506\u00a0<span style=\"color: #d19a66; line-height: 26px;\">21<\/span>:<span style=\"color: #d19a66; line-height: 26px;\">47<\/span>:<span style=\"color: #d19a66; line-height: 26px;\">48.658407<\/span>\u00a0<span style=\"color: #d19a66; line-height: 26px;\">2923565952<\/span>\u00a0fuse_all_reduce_op_pass.cc:<span style=\"color: #d19a66; line-height: 26px;\">74<\/span>]\u00a0Find\u00a0all_reduce\u00a0operators:\u00a0<span style=\"color: #d19a66; line-height: 26px;\">2.<\/span>\u00a0To\u00a0make\u00a0the\u00a0speed\u00a0faster,\u00a0some\u00a0all_reduce\u00a0ops\u00a0are\u00a0fused\u00a0during\u00a0training,\u00a0after\u00a0fusion,\u00a0the\u00a0number\u00a0of\u00a0all_reduce\u00a0ops\u00a0<span style=\"color: #c678dd; line-height: 26px;\">is<\/span>\u00a0<span style=\"color: #d19a66; line-height: 26px;\">1.<\/span><br \/>I0506\u00a0<span style=\"color: #d19a66; line-height: 26px;\">21<\/span>:<span style=\"color: #d19a66; line-height: 26px;\">47<\/span>:<span style=\"color: #d19a66; line-height: 26px;\">48.658516<\/span>\u00a0<span style=\"color: #d19a66; line-height: 26px;\">2923565952<\/span>\u00a0build_strategy.cc:<span style=\"color: #d19a66; line-height: 26px;\">365<\/span>]\u00a0SeqOnlyAllReduceOps:<span style=\"color: #d19a66; line-height: 26px;\">0<\/span>,\u00a0num_trainers:<span style=\"color: #d19a66; line-height: 26px;\">1<\/span><br \/>I0506\u00a0<span style=\"color: #d19a66; line-height: 26px;\">21<\/span>:<span style=\"color: #d19a66; line-height: 26px;\">47<\/span>:<span style=\"color: #d19a66; line-height: 26px;\">48.659137<\/span>\u00a0<span style=\"color: #d19a66; line-height: 26px;\">2923565952<\/span>\u00a0parallel_executor.cc:<span style=\"color: #d19a66; line-height: 26px;\">307<\/span>]\u00a0Inplace\u00a0strategy\u00a0<span style=\"color: #c678dd; line-height: 26px;\">is<\/span>\u00a0enabled,\u00a0when\u00a0build_strategy.enable_inplace\u00a0=\u00a0<span style=\"color: #56b6c2; line-height: 26px;\">True<\/span><br \/>I0506\u00a0<span style=\"color: #d19a66; line-height: 26px;\">21<\/span>:<span style=\"color: #d19a66; line-height: 26px;\">47<\/span>:<span style=\"color: #d19a66; line-height: 26px;\">48.659595<\/span>\u00a0<span style=\"color: #d19a66; line-height: 26px;\">2923565952<\/span>\u00a0parallel_executor.cc:<span style=\"color: #d19a66; line-height: 26px;\">375<\/span>]\u00a0Garbage\u00a0collection\u00a0strategy\u00a0<span style=\"color: #c678dd; line-height: 26px;\">is<\/span>\u00a0enabled,\u00a0when\u00a0FLAGS_eager_delete_tensor_gb\u00a0=\u00a0<span style=\"color: #d19a66; line-height: 26px;\">0<\/span><br \/>Your\u00a0Paddle\u00a0works\u00a0well\u00a0on\u00a0MUTIPLE\u00a0GPU\u00a0<span style=\"color: #c678dd; line-height: 26px;\">or<\/span>\u00a0CPU.<br \/>Your\u00a0Paddle\u00a0<span style=\"color: #c678dd; line-height: 26px;\">is<\/span>\u00a0installed\u00a0successfully!\u00a0Let<span style=\"color: #98c379; line-height: 26px;\">'s\u00a0start\u00a0deep\u00a0Learning\u00a0with\u00a0Paddle\u00a0now<br \/>&gt;&gt;&gt;\u00a0<\/span><\/code><\/pre>\n<p style=\"margin: 1em 4px; padding-top: 8px; padding-bottom: 8px; font-size: 16px; line-height: 26px; color: black; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; letter-spacing: 0.75px; text-align: left;\">\u770b\u5230 Your Paddle is installed successfully \u5c31\u8868\u793a\u5b89\u88c5\u6210\u529f\u4e86\u3002<\/p>\n<p style=\"margin: 1em 4px; padding-top: 8px; padding-bottom: 8px; font-size: 16px; line-height: 26px; color: black; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; letter-spacing: 0.75px; text-align: left;\">\u6211\u4eec\u63a5\u4e0b\u6765\u9700\u8981\u4f7f\u7528\u7684\u662f\u8fd9\u4e2a\u5e73\u53f0\u7684 paddlehub \u5de5\u5177\uff0c\u6240\u4ee5\u6211\u4eec\u8fd8\u9700\u8981\u5b89\u88c5 paddlehub \uff1a<\/p>\n<blockquote style=\"margin: 10px 5px; padding: 10px 10px 10px 20px; border-left-color: #35b378; color: #616161; font-size: 0.9em; overflow: auto; background: #fbf9fd; border-right: 0px solid #35b378; quotes: none; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; letter-spacing: 0.75px; text-align: left;\">\n<p style=\"padding-top: 8px; padding-bottom: 8px; font-size: 16px; line-height: 26px; color: black;\">pip install -i https:\/\/mirror.baidu.com\/pypi\/simple paddlehub<\/p>\n<\/blockquote>\n<p style=\"margin: 1em 4px; padding-top: 8px; padding-bottom: 8px; font-size: 16px; line-height: 26px; color: black; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; letter-spacing: 0.75px; text-align: left;\">\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u5f00\u59cb\u8fd0\u7528\u4e86\u3002<\/p>\n<h2 style=\"margin-top: 1em; margin-bottom: 0rem; padding-top: 0.5em; padding-bottom: 0.5em; font-weight: bold; font-size: 23px; color: #35b378; line-height: 32px; display: inline-block; border-bottom: 0px solid #35b378; border-top-color: #35b378; border-right-color: #35b378; border-left-color: #35b378; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; letter-spacing: 0.75px; text-align: left;\">\u4ee3\u7801\u5b9e\u73b0<\/h2>\n<p>\u00a0<\/p>\n<p style=\"margin: 1em 4px; padding-top: 8px; padding-bottom: 8px; font-size: 16px; line-height: 26px; color: black; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; letter-spacing: 0.75px; text-align: left;\">\u6211\u4eec\u7684\u5b9e\u73b0\u6b65\u9aa4\u5f88\u7b80\u5355\uff1a\u5bfc\u5165\u6a21\u5757 -&gt; \u52a0\u8f7d\u6a21\u578b -&gt; \u83b7\u53d6\u56fe\u7247\u6587\u4ef6 -&gt; \u8c03\u7528\u6a21\u5757\u62a0\u56fe\u3002<\/p>\n<p style=\"margin: 1em 4px; padding-top: 8px; padding-bottom: 8px; font-size: 16px; line-height: 26px; color: black; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; letter-spacing: 0.75px; text-align: left;\">\u4e0b\u9762\u6211\u4eec\u770b\u4ee3\u7801\u5b9e\u73b0\uff1a<\/p>\n<pre style=\"margin-top: 10px; margin-bottom: 10px; font-size: 15px; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; overflow: auto; color: #595959; letter-spacing: 0.75px; text-align: left;\"><code style=\"padding: 16px; font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; font-size: 12px; display: -webkit-box; overflow-x: auto; color: #abb2bf; background: #282c34; border-radius: 0px;\"><span style=\"color: #c678dd; line-height: 26px;\">import<\/span>\u00a0os,\u00a0paddlehub\u00a0<span style=\"color: #c678dd; line-height: 26px;\">as<\/span>\u00a0hub<br \/>huseg\u00a0=\u00a0hub.Module(name=<span style=\"color: #98c379; line-height: 26px;\">'deeplabv3p_xception65_humanseg'<\/span>)\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u52a0\u8f7d\u6a21\u578b<\/span><br \/>path\u00a0=\u00a0<span style=\"color: #98c379; line-height: 26px;\">'.\/imgs\/'<\/span>\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u6587\u4ef6\u76ee\u5f55<\/span><br \/>files\u00a0=\u00a0[path\u00a0+\u00a0i\u00a0<span style=\"color: #c678dd; line-height: 26px;\">for<\/span>\u00a0i\u00a0<span style=\"color: #c678dd; line-height: 26px;\">in<\/span>\u00a0os.listdir(path)]\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u83b7\u53d6\u6587\u4ef6\u5217\u8868<\/span><br \/>results\u00a0=\u00a0huseg.segmentation(data={<span style=\"color: #98c379; line-height: 26px;\">'image'<\/span>:\u00a0files})\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u00a0\u62a0\u56fe<\/span><\/code><\/pre>\n<p style=\"margin: 1em 4px; padding-top: 8px; padding-bottom: 8px; font-size: 16px; line-height: 26px; color: black; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; letter-spacing: 0.75px; text-align: left;\">\u6211\u5c06\u56fe\u7247\u653e\u5728\u4ee3\u7801\u6587\u4ef6\u5939\u7684\u540c\u7ea7\u76ee\u5f55 imgs \u6587\u4ef6\u5939\u4e0b\uff0c\u8fd0\u884c\u4ee3\u7801\u540e\uff0c\u8f93\u51fa\u7684\u62a0\u56fe\u56fe\u7247\u4f1a\u81ea\u52a8\u653e\u5728\u4ee3\u7801\u540c\u7ea7\u76ee\u5f55\u7684 humanseg_output \u76ee\u5f55\u4e0b\uff0c\u6587\u4ef6\u540d\u79f0\u8ddf\u539f\u56fe\u7247\u7684\u540d\u79f0\u76f8\u540c\uff0c\u4f46\u662f\u6587\u4ef6\u683c\u5f0f\u662f png \u3002<\/p>\n<p style=\"margin: 1em 4px; padding-top: 8px; padding-bottom: 8px; font-size: 16px; line-height: 26px; color: black; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; letter-spacing: 0.75px; text-align: left;\">\u6211\u5728 imgs \u76ee\u5f55\u4e0b\u653e\u4e865\u5f20\u56fe\u7247\uff0c\u4e3a\u4e86\u4fbf\u4e8e\u5c55\u793a\uff0c\u6211\u5c06\u4ed6\u4eec\u653e\u5728\u4e00\u8d77\u622a\u56fe\uff1a<\/p>\n<p>\u00a0<\/p>\n<figure style=\"margin-top: 10px; margin-bottom: 10px; color: #595959; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; font-size: 15px; letter-spacing: 0.75px; text-align: left;\">\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"rich_pages\" style=\"box-sizing: border-box !important; width: 677px !important; visibility: visible !important;\" title=\"Python\u88c5\u903c\u6307\u5357\u2014\u2014\u4e94\u884c\u4ee3\u7801\u5b9e\u73b0\u6279\u91cf\u62a0\u56fe\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2020\/05\/9-1589473785.png\" alt=\"Python\u88c5\u903c\u6307\u5357\u2014\u2014\u4e94\u884c\u4ee3\u7801\u5b9e\u73b0\u6279\u91cf\u62a0\u56fe\" \/><\/p>\n<figcaption style=\"margin-top: 5px; text-align: center; color: #888888; font-size: 14px;\">\u539f\u56fe\u7247<\/figcaption>\n<\/figure>\n<p>\u00a0<\/p>\n<p style=\"margin: 1em 4px; padding-top: 8px; padding-bottom: 8px; font-size: 16px; line-height: 26px; color: black; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; letter-spacing: 0.75px; text-align: left;\">\u8fd0\u884c\u7a0b\u5e8f\u540e\uff0c\u5728 humanseg_output \u76ee\u5f55\u4e0b\u751f\u6210\u4e865\u5f20\u56fe\u7247\uff0c\u540c\u6837\u7684\uff0c\u6211\u5c06\u4ed6\u4eec\u653e\u5728\u4e00\u8d77\u622a\u56fe\uff1a<\/p>\n<p>\u00a0<\/p>\n<figure style=\"margin-top: 10px; margin-bottom: 10px; color: #595959; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; font-size: 15px; letter-spacing: 0.75px; text-align: left;\">\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"rich_pages\" style=\"background-color: #eeedeb; background-size: 22px; background-position: center center; background-repeat: no-repeat; box-sizing: border-box !important; height: 533.225px !important; width: 677px !important; border: 1px solid #eeedeb;\" title=\"Python\u88c5\u903c\u6307\u5357\u2014\u2014\u4e94\u884c\u4ee3\u7801\u5b9e\u73b0\u6279\u91cf\u62a0\u56fe\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2020\/05\/1-1589473785.png\" alt=\"Python\u88c5\u903c\u6307\u5357\u2014\u2014\u4e94\u884c\u4ee3\u7801\u5b9e\u73b0\u6279\u91cf\u62a0\u56fe\" \/><\/p>\n<figcaption style=\"margin-top: 5px; text-align: center; color: #888888; font-size: 14px;\">\u62a0\u56fe\u56fe\u7247<\/figcaption>\n<\/figure>\n<p>\u00a0<\/p>\n<p style=\"margin: 1em 4px; padding-top: 8px; padding-bottom: 8px; font-size: 16px; line-height: 26px; color: black; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; letter-spacing: 0.75px; text-align: left;\">\u6211\u4eec\u53ef\u4ee5\u770b\u5230\u7a0b\u5e8f\u5c06\u6bcf\u5f20\u56fe\u7247\u4e2d\u7684\u4eba\u7269\uff08\u53ef\u4ee5\u662f\u4e00\u4e2a\uff0c\u4e5f\u53ef\u4ee5\u662f\u591a\u4e2a\uff09\u8bc6\u522b\u51fa\u6765\uff0c\u5e76\u4e14\u62a0\u51fa\u6765\u6210\u56fe\uff0c\u80cc\u666f\u662f\u767d\u8272\u3002\u867d\u7136\u6709\u4e9b\u7ec6\u8282\u5904\u8fd8\u6709\u4e9b\u8bb8\u7455\u75b5\uff0c\u4f46\u662f\u770b\u8d77\u6765\u8fd8\u7b97\u4e0d\u9519\u3002<\/p>\n<h2 style=\"margin-top: 1em; margin-bottom: 0rem; padding-top: 0.5em; padding-bottom: 0.5em; font-weight: bold; font-size: 23px; color: #35b378; line-height: 32px; display: inline-block; border-bottom: 0px solid #35b378; border-top-color: #35b378; border-right-color: #35b378; border-left-color: #35b378; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; letter-spacing: 0.75px; text-align: left;\">\u603b\u7ed3<\/h2>\n<p>\u00a0<\/p>\n<p style=\"margin: 1em 4px; padding-top: 8px; padding-bottom: 8px; font-size: 16px; line-height: 26px; color: black; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; letter-spacing: 0.75px; text-align: left;\">\u672c\u6587\u57fa\u4e8e paddlepaddle \u5e73\u53f0\uff0c\u4f7f\u7528\u7b80\u5355\u7684\u4e94\u884c\u4ee3\u7801\u5b9e\u73b0\u4e86\u6279\u91cf\u62a0\u56fe\uff0c\u4e0d\u4ec5\u89e3\u653e\u4e86\u597d\u591a\u4eba\u7684\u53cc\u624b\u548c\u53cc\u773c\uff0c\u800c\u4e14\u4e3a\u67d0\u4e9b\u7a0b\u5e8f\u733f\/\u7a0b\u5e8f\u5a9b\u7684\u88c5\u903c\u5de5\u5177\u7bb1\u63d0\u4f9b\u4e86\u4e00\u4ef6\u5b9d\u5668\u3002\u4e0b\u6b21\u5982\u679c\u78b0\u5230\u67d0\u4e2a\u5973\u751f\u6216\u8005\u95fa\u871c\u5728\u4e3a\u62a0\u56fe\u53d1\u6101\uff0c\u522b\u5fd8\u4e86\u638f\u51fa\u795e\u5668\uff0c\u8d62\u5f97\u82b3\u5fc3\u54e6\uff01<\/p>\n<\/div>\n\n\n<p>\u8f6c\u81ea\uff1ahttps:\/\/mp.weixin.qq.com\/s\/0K1YiR_tCnfg65ZoN8QUqQ<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587 |\u00a0\u95f2\u6b22 \u6765\u6e90\uff1aPython \u6280\u672f\u300cID: pythonall\u300d \u4f60\u662f\u5426\u66fe\u7ecf\u60f3\u5c06\u67d0\u5f20\u7167\u7247\u4e2d\u7684\u4eba\u7269\u62a0\u51fa\u6765\uff0c\u7136 &hellip; <a href=\"http:\/\/www.zhushiyao.com\/?p=25791\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u201cPython\u88c5\u903c\u6307\u5357\u2014\u2014\u4e94\u884c\u4ee3\u7801\u5b9e\u73b0\u6279\u91cf\u62a0\u56fe\u201d<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[8,600],"_links":{"self":[{"href":"http:\/\/www.zhushiyao.com\/index.php?rest_route=\/wp\/v2\/posts\/25791"}],"collection":[{"href":"http:\/\/www.zhushiyao.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.zhushiyao.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.zhushiyao.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.zhushiyao.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=25791"}],"version-history":[{"count":2,"href":"http:\/\/www.zhushiyao.com\/index.php?rest_route=\/wp\/v2\/posts\/25791\/revisions"}],"predecessor-version":[{"id":25801,"href":"http:\/\/www.zhushiyao.com\/index.php?rest_route=\/wp\/v2\/posts\/25791\/revisions\/25801"}],"wp:attachment":[{"href":"http:\/\/www.zhushiyao.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=25791"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.zhushiyao.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=25791"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.zhushiyao.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=25791"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}