文档错误
Created by: 60999
https://github.com/PaddlePaddle/Paddle.js/blob/master/tools/ModelConverter/README_cn.md
其中
1.2. 快速上手
- 如果待转换的 fluid 模型为
合并参数文件
,即一个模型对应一个参数文件:
python convertToPaddleJSModel.py --modelPath=<fluid_model_file_path> --paramPath=<fluid_param_file_path> --outputDir=<paddlejs_model_directory>
- 如果待转换的 fluid 模型为
分片参数文件
,即一个模型文件对应多个参数文件:
# 注意,使用这种方式调用转换器,需要保证 inputDir 中,模型文件名为'__model__'
python convertToPaddleJSModel.py --inputDir=<fluid_model_directory> --outputDir=<paddlejs_model_directory>
应该改为
### 1.2. 快速上手
- 如果待转换的 fluid 模型为`分片参数文件`,即一个模型文件对应多个参数文件:
``` bash
python convertToPaddleJSModel.py --modelPath=<fluid_model_file_path> --paramPath=<fluid_param_file_path> --outputDir=<paddlejs_model_directory>
- 如果待转换的 fluid 模型为`合并参数文件`,即一个模型对应一个参数文件:
# 注意,使用这种方式调用转换器,需要保证 inputDir 中,模型文件名为'__model__'
python convertToPaddleJSModel.py --inputDir=<fluid_model_directory> --outputDir=<paddlejs_model_directory>
在aistudio上实测:
ll output/mobilenetv3_large_ssld_Infer
total 17184
drwxr-xr-x 2 aistudio aistudio 4096 Jun 25 11:02 ./
drwxr-xr-x 6 aistudio aistudio 4096 Jun 25 14:00 ../
-rw-r--r-- 1 aistudio aistudio 667718 Jun 25 11:04 __model__
-rw-r--r-- 1 aistudio aistudio 622 Jun 25 11:04 model.yml
-rw-r--r-- 1 aistudio aistudio 16911818 Jun 25 11:04 __params__
-rw-r--r-- 1 aistudio aistudio 0 Jun 25 11:04 .success
`! python convertToPaddleJSModel.py --modelPath=/home/aistudio/output/mobilenetv3_large_ssld_Infer/__model__ --paramPath=/home/aistudio/output/mobilenetv3_large_ssld_Infer/__params__ --outputDir=/home/aistudio/output/mobilenetv3_large_ssld_paddlejs`
`============Convert Model Args=============
modelPath: /home/aistudio/output/mobilenetv3_large_ssld_Infer/__model__
paramPath: /home/aistudio/output/mobilenetv3_large_ssld_Infer/__params__
outputDir: /home/aistudio/output/mobilenetv3_large_ssld_paddlejs
enableOptimizeModel: 0
enableLogModelInfo: 0
sliceDataSize:4096
Starting...
You choosed not to optimize model, consequently, optimizing model is skiped.
Converting model...
Organizing model operators info...
Organizing model operators info successfully.
Organizing model variables info...
Organizing model variables info successfully.
Dumping model structure to json file...
Dumping model structure to json file successfully
Output No.1 binary file, remain 3177624 param values.
Output No.2 binary file, remain 2129048 param values.
Output No.3 binary file, remain 1080472 param values.
Output No.4 binary file, remain 31896 param values.
Output No.5 binary file, remain 0 param values.
Slicing data to binary files successfully. (5 output files and 4226200 param values)
Converting model successfully.
============ALL DONE============
`
`$ ll output/mobilenetv3_large_ssld_paddlejs
total 16868
drwxr-xr-x 2 aistudio aistudio 4096 Jun 25 14:00 ./
drwxr-xr-x 6 aistudio aistudio 4096 Jun 25 14:00 ../
-rw-r--r-- 1 aistudio aistudio 4194304 Jun 25 14:00 chunk_1.dat
-rw-r--r-- 1 aistudio aistudio 4194304 Jun 25 14:00 chunk_2.dat
-rw-r--r-- 1 aistudio aistudio 4194304 Jun 25 14:00 chunk_3.dat
-rw-r--r-- 1 aistudio aistudio 4194304 Jun 25 14:00 chunk_4.dat
-rw-r--r-- 1 aistudio aistudio 127584 Jun 25 14:00 chunk_5.dat
-rw-r--r-- 1 aistudio aistudio 355062 Jun 25 14:00 model.json`
但是 python convertToPaddleJSModel.py --inputDir=<fluid_model_directory> --outputDir=<paddlejs_model_directory>
不知道如何使用,请指导一下,谢谢!