未验证 提交 725a8ffd 编写于 作者: T Tingquan Gao 提交者: GitHub

Update usage, test=document_fix (#647)

上级 2c232b74
......@@ -233,15 +233,7 @@ Among them, the `--model` parameter is used to specify the model name, `--pretra
**Note**:
1. If `--output_path=./inference`, then three files will be generated in the folder `inference`, they are `inference.pdiparams`, `inference.pdmodel` and `inference.pdiparams.info`.
2. In the file `export_model.py:line53`, the `shape` parameter is the shape of the model input image, the default is `224*224`. Please modify it according to the actual situation, as shown below:
```python
50 # Please modify the 'shape' according to actual needs
51 @to_static(input_spec=[
52 paddle.static.InputSpec(
53 shape=[None, 3, 224, 224], dtype='float32')
54 ])
```
2. You can specify the `shape` of the model input image by setting the parameter `--img_size`, the default is `224`, which means the shape of input image is `224*224`.
The above command will generate the model structure file (`inference.pdmodel`) and the model weight file (`inference.pdiparams`), and then the inference engine can be used for inference:
......
......@@ -245,14 +245,7 @@ python tools/export_model.py \
**注意**
1. `--output_path`表示输出的inference模型文件夹路径,若`--output_path=./inference`,则会在`inference`文件夹下生成`inference.pdiparams``inference.pdmodel``inference.pdiparams.info`文件。
2. 文件`export_model.py:line53`中,`shape`参数为模型输入图像的`shape`,默认为`224*224`,请根据实际情况修改,如下所示:
```python
50 # Please modify the 'shape' according to actual needs
51 @to_static(input_spec=[
52 paddle.static.InputSpec(
53 shape=[None, 3, 224, 224], dtype='float32')
54 ])
```
2. 可以通过设置参数`--img_size`指定模型输入图像的`shape`,默认为`224`,表示图像尺寸为`224*224`,请根据实际情况修改。
上述命令将生成模型结构文件(`inference.pdmodel`)和模型权重文件(`inference.pdiparams`),然后可以使用预测引擎进行推理:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册