You need to sign in or sign up before continuing.
未验证 提交 8d7524ac 编写于 作者: J Jason 提交者: GitHub

Update README.md

上级 eaf7de57
......@@ -25,7 +25,7 @@ tensorflow2fluid支持将训练好的TensorFlow模型转至PaddlePaddle fluid模
|参数|说明|
|------------------|-----------------------------------------------|
|meta_file|TensorFlow模型序列化后保存的meta文件|
|ckpt_file|TensorFlow保存的ckpt格式模型参数|
|ckpt_file|TensorFlow模型保存checkpoint目录|
|pb_file|Tensorflow保存的pb格式模型|
|input_nodes|输入tensor名,多个输入时以空格分隔|
|input_shape|输入tensor的shape(batch维度以None表示),shape之间以空格分隔,shape内各维度以逗号分隔,须与input_nodes对应|
......@@ -33,3 +33,16 @@ tensorflow2fluid支持将训练好的TensorFlow模型转至PaddlePaddle fluid模
|save_dir|转换后的模型保存路径|
目前TensorFlow保存的模型主要包括ckpt和pb两种类型。其中加载ckpt模型时,同时也需通过meta文件导入网络结构;而pb模型则已将网络结构和参数均序列化至同一个文件。因此,加载ckpt模型时,需指定meta_file和ckpt_file,而加载pb模型,则只需指定pb_file即可。
例:将inception_v3模型转换至PaddlePaddle
```Bash
wget http://download.tensorflow.org/models/inception_v3_2016_08_28.tar.gz
tar xzvf http://download.tensorflow.org/models/inception_v3_2016_08_28.tar.gz
python demo/inception_v3/export_to_checkpoint.py inception_v3.py checkpoint
python convert.py --meta_file checkpoint/model.meta \
--ckpt_dir checkpoint \
--in_nodes inputs \
--input_shape None,299,299,3 \
--output_nodes InceptionV3/Logits/SpatialSqueeze \
--save_dir paddle_inception_v3
```
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册