From 41d1a654abfce3d70dd3d927d276f44229e4a816 Mon Sep 17 00:00:00 2001 From: Tingquan Gao Date: Thu, 17 Dec 2020 23:20:14 +0800 Subject: [PATCH] [Cherry Pick] Fix "tar" to "pdparams" to adapt to dygraph (#497) * Fix "tar" to "pdparams" to adapt to dygraph * Update the download link of Paddle Inference Library --- deploy/cpp_infer/docs/windows_vs2019_build.md | 10 +++++----- ppcls/utils/model_zoo.py | 6 +++--- tools/download.py | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/deploy/cpp_infer/docs/windows_vs2019_build.md b/deploy/cpp_infer/docs/windows_vs2019_build.md index 1f97f350..634aff17 100755 --- a/deploy/cpp_infer/docs/windows_vs2019_build.md +++ b/deploy/cpp_infer/docs/windows_vs2019_build.md @@ -12,13 +12,13 @@ PaddleClas在Windows 平台下基于`Visual Studio 2019 Community` 进行了测 **下面所有示例以工作目录为 `D:\projects`演示**。 -### Step1: 下载PaddlePaddle C++ 预测库 fluid_inference +### Step1: 下载PaddlePaddle C++ 预测库 paddle_inference_install_dir -PaddlePaddle C++ 预测库针对不同的`CPU`和`CUDA`版本提供了不同的预编译版本,请根据实际情况下载: [C++预测库下载列表](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/advanced_guide/inference_deployment/inference/windows_cpp_inference.html)。 +PaddlePaddle C++ 预测库针对不同的`CPU`和`CUDA`版本提供了不同的预编译版本,请根据实际情况下载: [C++预测库下载列表](https://www.paddlepaddle.org.cn/documentation/docs/zh/2.0-rc1/guides/05_inference_deployment/inference/windows_cpp_inference.html)。 -解压后`D:\projects\fluid_inference`目录包含内容为: +解压后`D:\projects\paddle_inference_install_dir`目录包含内容为: ``` -fluid_inference +paddle_inference_install_dir ├── paddle # paddle核心库和头文件 | ├── third_party # 第三方依赖库和头文件 @@ -62,7 +62,7 @@ fluid_inference | CMAKE_BUILD_TYPE | RelWithDebInfo | [√] | | CUDA_LIB | CUDA的库路径 | [√] | | CUDNN_LIB | CUDNN的库路径 | [√] | -| OPENCV_DIR | OpenCV的安装路径 | [√] | +| OpenCV_DIR | OpenCV的安装路径 | [√] | | PADDLE_LIB | Paddle预测库的路径 | [√] | | WITH_GPU | [√] | [√] | | WITH_MKL | [√] | [√] | diff --git a/ppcls/utils/model_zoo.py b/ppcls/utils/model_zoo.py index 44a11c56..d837aff2 100644 --- a/ppcls/utils/model_zoo.py +++ b/ppcls/utils/model_zoo.py @@ -58,8 +58,8 @@ class RetryError(Exception): super(RetryError, self).__init__(message) -def _get_url(architecture, postfix="tar"): - prefix = "https://paddle-imagenet-models-name.bj.bcebos.com/" +def _get_url(architecture, postfix="pdparams"): + prefix = "https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/" fname = architecture + "_pretrained." + postfix return prefix + fname @@ -201,7 +201,7 @@ def list_models(): return -def get(architecture, path, decompress=True, postfix="tar"): +def get(architecture, path, decompress=False, postfix="pdparams"): """ Get the pretrained model. """ diff --git a/tools/download.py b/tools/download.py index 1523a781..7053634c 100644 --- a/tools/download.py +++ b/tools/download.py @@ -29,8 +29,8 @@ def parse_args(): parser = argparse.ArgumentParser() parser.add_argument('-a', '--architecture', type=str, default='ResNet50') parser.add_argument('-p', '--path', type=str, default='./pretrained/') - parser.add_argument('--postfix', type=str, default="tar") - parser.add_argument('-d', '--decompress', type=str2bool, default=True) + parser.add_argument('--postfix', type=str, default="pdparams") + parser.add_argument('-d', '--decompress', type=str2bool, default=False) parser.add_argument('-l', '--list', type=str2bool, default=False) args = parser.parse_args() -- GitLab