зеркало из https://github.com/microsoft/MMdnn.git
Merge pull request #471 from LourensT/patch-1
minor edits and minor clarifications
This commit is contained in:
Коммит
b9c11b4949
|
@ -24,7 +24,7 @@ $ pip install https://cntk.ai/PythonWheel/CPU-Only/cntk-2.4-cp35-cp35m-linux_x86
|
|||
|
||||
## Keras Model Preparation
|
||||
|
||||
You need to prepare your pre-trained keras model firstly. And there is a pre-trained model extractor for frameworks to help you. You can refer it to extract your Keras model structure and weights.
|
||||
First, you'll need to prepare your pre-trained keras model. There is a pre-trained model extractor for frameworks to do this. Refer to it to extract your Keras model's structure and weights.
|
||||
|
||||
```bash
|
||||
$ mmdownload -f keras -n inception_v3
|
||||
|
@ -32,7 +32,7 @@ $ mmdownload -f keras -n inception_v3
|
|||
Keras model inception_v3 is saved in [./imagenet_inception_v3.h5]
|
||||
```
|
||||
|
||||
The you got the Keras pre-trained inception_v3 model which is downloaded to current working directory.
|
||||
Then you got the Keras pre-trained inception_v3 model which is downloaded to the current working directory.
|
||||
|
||||
---
|
||||
|
||||
|
@ -42,7 +42,7 @@ We provide two ways to convert models.
|
|||
|
||||
### **One-step Command**
|
||||
|
||||
Above MMdnn@0.1.4, we provide one command to achieve the conversion
|
||||
For versions above MMdnn@0.1.4, we provide one command to achieve converting a Keras Model to CNTK.
|
||||
|
||||
```bash
|
||||
$ mmconvert -sf keras -iw imagenet_inception_v3.h5 -df cntk -om keras_to_cntk_inception_v3.dnn
|
||||
|
@ -52,7 +52,7 @@ $ mmconvert -sf keras -iw imagenet_inception_v3.h5 -df cntk -om keras_to_cntk_in
|
|||
CNTK model file is saved as [keras_to_cntk_inception_v3.dnn], generated by [2c33f7f278cb46be992f50226fcfdb5d.py] and [2c33f7f278cb46be992f50226fcfdb5d.npy].
|
||||
```
|
||||
|
||||
Then you get the CNTK original model *keras_to_cntk_inception_v3.dnn* converted from Keras. **2c33f7f278cb46be992f50226fcfdb5d.py** and **2c33f7f278cb46be992f50226fcfdb5d.npy** are temporal files which will be removed automatically.
|
||||
Now you've got the CNTK original model *keras_to_cntk_inception_v3.dnn*, converted from Keras in one step!. **2c33f7f278cb46be992f50226fcfdb5d.py** and **2c33f7f278cb46be992f50226fcfdb5d.npy** are temporal files which will be removed automatically.
|
||||
|
||||
### **Step-by-step Command (for debugging)**
|
||||
|
||||
|
@ -81,9 +81,9 @@ Parse file [converted.pb] with binary format successfully.
|
|||
Target network code snippet is saved as [converted_cntk.py].
|
||||
```
|
||||
|
||||
And you will get a filename *converted_cntk.py*, which contains the **original CNTK** codes to build the *Inception V3* network.
|
||||
And you will get a file named *converted_cntk.py*, which contains the **original CNTK** codes to build the *Inception V3* network.
|
||||
|
||||
With the three steps, you have already converted the pre-trained Keras Inception_v3 models to CNTK network file *converted_cntk.py* and weight file *converted.npy*. You can use these two files to fine-tune training or inference.
|
||||
With these three steps, you have already converted the pre-trained Keras Inception_v3 models to CNTK network file *converted_cntk.py* and weight file *converted.npy*. You can use these two files to fine-tune training or inference.
|
||||
|
||||
#### Dump the original CNTK model
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче