Update usage, test=document_fix (#646)
parent
2c0dcaf9ce
commit
1b920e8a44
|
@ -234,15 +234,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:
|
||||
|
||||
|
|
|
@ -246,14 +246,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`),然后可以使用预测引擎进行推理:
|
||||
|
||||
|
|
Loading…
Reference in New Issue