pretty code

2020年2月17日 星期一

Run MLPerf-inference Mobilenet on Windows.

My Environment

Windows 7 x64
Python 3.6.8 x64

Install python modules

1. pip install TensorFlow==2.0.0
2. pip install wheel
3. pip install Cython
4. pip install onnx
5. pip install git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI(This is pycocotools module that someone built).

Install Load_Gen

1. cd mlperf\loadgen
2. set CFLAGS=-std=c++14
3. python setup.py develop
4. cd mlperf\v0.5\classification_and_detection
5. python setup.py develop

Prepare Dataset

Because the link of imagenet is gone, you must search by Google.

Prepare Model

https://zenodo.org/record/2269307/files/mobilenet_v1_1.0_224.tgz

Run Mobilenet-tflite

1. cd mlperf\v0.5\classification_and_detection
2. modify python\main.py, add profile below.
"mobilenet-tflite": {
    "inputs": "input:0",
    "outputs": "MobilenetV1/Predictions/Reshape_1:0",
    "dataset": "imagenet_mobilenet",
    "backend": "tflite",
    "model-name": "mobilenet",
},
3. py python\main.py --backend=tflite --cache=1 --config=..\mlperf.conf --dataset-path=D:\MLPerf-Win\Dataset\dataset-imagenet-ilsvrc2012-val --max-batchsize=1 --model=D:\MLPerf-Win\Model\mobilenet_v1_1.0_224.tflite --model-name=mobilenet --profile=mobilenet-tflite --scenario=SingleStream --threads=2 --output=D:\MLPerf-Win\Result\tflite-mobilenet-singlestream

沒有留言: