Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add three trained image classification models on ImageNet. #370

Merged
merged 3 commits into from
Oct 13, 2017

Conversation

guoshengCS
Copy link
Collaborator

@guoshengCS guoshengCS commented Oct 13, 2017

Add three trained image classification models on ImageNet.

fixes #369

Copy link
Collaborator

@lcy-seso lcy-seso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost LGTM, thank you.

@@ -221,3 +221,8 @@ for file_name, result in zip(file_list, lab):
```

首先从文件中加载训练好的模型(代码里以第10轮迭代的结果为例),然后读取`image_list_file`中的图像。`image_list_file`是一个文本文件,每一行为一个图像路径。代码使用`paddle.infer`判断`image_list_file`中每个图像的类别,并进行输出。

## 使用预训练模型
为方便进行测试和fine-tuning,我们提供了一些对应于示例中模型配置的预训练模型,目前包括ResNet50、ResNet101和Vgg16这几种模型,并提供脚本`model_download.sh`进行模型下载,如下载ResNet50可执行"`sh model_download.sh ResNet50`",完成后`Paddle_ResNet50.tar.gz`即是相应模型,可参照示例代码进行加载。
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • 请补充提供一些关于这三个模型的基本训练情况,什么数据集上训练的模型。
  • "可参照示例代码进行加载。" -- 什么示例代码,可否说的直接明了一些。

  1. 目前包括ResNet50、ResNet101和Vgg16这几种模型 --> 目前包括ResNet50、ResNet101和Vgg16。
  2. 并提供脚本model_download.sh进行模型下载 --> 请使用脚本model_download.sh进行下载。
  3. 完成后Paddle_ResNet50.tar.gz即是相应模型 --> 完成后同目录下的Paddle_ResNet50.tar.gz即是训练好的模型。

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

## 使用预训练模型
为方便进行测试和fine-tuning,我们提供了一些对应于示例中模型配置的预训练模型,目前包括ResNet50、ResNet101和Vgg16这几种模型,并提供脚本`model_download.sh`进行模型下载,如下载ResNet50可执行"`sh model_download.sh ResNet50`",完成后`Paddle_ResNet50.tar.gz`即是相应模型,可参照示例代码进行加载。

需要注意,模型压缩包中所含各文件名对应了模型中的各参数名,这是模型参数加载的依据,所以需要保证网络配置中的参数名能够正确对应到相应的文件。这里提供的模型均使用了示例代码中的配置,如需修改网络配置并使用提供的模型请多加注意。
Copy link
Collaborator

@lcy-seso lcy-seso Oct 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

注意事项:

模型压缩包中所含各文件的文件名和模型配置中的参数名一一对应,是加载模型参数的依据。我们提供的预训练模型均使用了图像分类目录下示例代码中的配置,如需修改网络配置,请多加注意,需要保证网络配置中的参数名和压缩包中的文件名能够正确对应。

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@@ -0,0 +1,55 @@
#! /usr/bin/env bash
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

建立一个 models 文件夹,把这个脚本放在 models 下面。

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Collaborator

@lcy-seso lcy-seso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you.

@lcy-seso lcy-seso merged commit 8029f1c into PaddlePaddle:develop Oct 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add three trained image classification models on ImageNet.
2 participants