In the official web site, the format of the link of SSD-ResNet34 model is "NCHW". This format is usually for GPU. It means that we can not use it on TensorFlow.
I found a link after searching google. It seems that the format is "NHWC". I used this mode to run MLPerf v0.5. I got the result finally.
The link is shown below.
https://zenodo.org/record/3246481#.XvmdbCgzaUk
I used these below parameters to run MLPerf.
./run_local.sh tf ssd-resnet34 cpu --data-format NHWC
Although I got the result, there was errors of "only size-1 arrays can be converted to Python scalars". I will check it later.
Reference
https://github.com/mlperf/inference/issues/219
https://github.com/mlperf/inference/issues/229
pretty code
2020年6月29日 星期一
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.
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-singlestream2020年2月7日 星期五
TensorFlow 和 numpy 相容性問題
跑較高版本 TensorFlow 時,都會出現下列訊息:
FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy
Google 了一下,是因為 numpy 版本太新,只要安裝 numpy 1.16 版本即可。
FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy
Google 了一下,是因為 numpy 版本太新,只要安裝 numpy 1.16 版本即可。
2019年9月12日 星期四
慘不忍睹的 MLPerf 試用
MLPerf 是幾家大公司為了讓機器學習可以有個共同的比較標準,所釋放出來的 open source 專案。
試用了幾個 item,根本不是一般電腦可以跑的。
推薦系統需要 400 G 的記憶體,GG。
image classification 跑起來則是一堆問題,文件寫的不清不楚,docker container 的跑法一直搞不定,只好直接用本機 CPU 版本試跑,雖然最後可以成功跑起來,但一開始訓練的正確率只有 0,不知道能不能順利的跑完?
根據個人不負責任猜測,應該可以順利跑完,感覺是每跑完一項﹝100 step﹞就會釋放記憶體,除非有 memory leak,不然跑個幾個月應該可以達到它要求的 0.749 accuracy 吧!
https://www.mlperf.org/
2019/09/13 更新
後來想了一下,應該是 Dockfile 撰寫有問題,裡面指定的某些軟體版本不對,待驗證﹝參考 2019/09/16更新﹞。
上圖是 MLPerf 某個 issue 圖片,看的出來 100 個 step 要跑約 20 秒,跑到 2,008,925 才有 0.78 的正確率,換算下來:
2,008,925 / 100 x 21 / 60 / 60 / 24 = 48.63 天
如果是我的電腦,100 個 step 要跑約 30 分鐘:
2,008,925 / 100 x 30 / 60 / 24 = 418.53 天
2019/09/16 更新
如果是使用 MLPerfV0.5,記得修改 image_classification/tensorflow/Dockerfile,tf-nightly-gpu -> tensorflow-gpu==1.12.0,docker 才可以順利運行,不過由於我的 GPU Card 只有 2G 記憶體,最後還是不能執行,會出現 OOM Error﹝out of memory﹞。
2019/09/17 更新
覺得 MLPerf 還不夠友善,也許因為 contributor 都是大廠大牛,有問題都能自行解決,故沒考慮到一般人,可能要等到 1.0 後再來試用比較好。剛才在 github 順便回答了 2 個問題,希望可以幫助到跟我有一樣困擾的人。
試用了幾個 item,根本不是一般電腦可以跑的。
推薦系統需要 400 G 的記憶體,GG。
image classification 跑起來則是一堆問題,文件寫的不清不楚,docker container 的跑法一直搞不定,只好直接用本機 CPU 版本試跑,雖然最後可以成功跑起來,但一開始訓練的正確率只有 0,不知道能不能順利的跑完?
根據個人不負責任猜測,應該可以順利跑完,感覺是每跑完一項﹝100 step﹞就會釋放記憶體,除非有 memory leak,不然跑個幾個月應該可以達到它要求的 0.749 accuracy 吧!
https://www.mlperf.org/
2019/09/13 更新
後來想了一下,應該是 Dockfile 撰寫有問題,裡面指定的某些軟體版本不對,待驗證﹝參考 2019/09/16更新﹞。
上圖是 MLPerf 某個 issue 圖片,看的出來 100 個 step 要跑約 20 秒,跑到 2,008,925 才有 0.78 的正確率,換算下來:
2,008,925 / 100 x 21 / 60 / 60 / 24 = 48.63 天
如果是我的電腦,100 個 step 要跑約 30 分鐘:
2,008,925 / 100 x 30 / 60 / 24 = 418.53 天
2019/09/16 更新
如果是使用 MLPerfV0.5,記得修改 image_classification/tensorflow/Dockerfile,tf-nightly-gpu -> tensorflow-gpu==1.12.0,docker 才可以順利運行,不過由於我的 GPU Card 只有 2G 記憶體,最後還是不能執行,會出現 OOM Error﹝out of memory﹞。
2019/09/17 更新
覺得 MLPerf 還不夠友善,也許因為 contributor 都是大廠大牛,有問題都能自行解決,故沒考慮到一般人,可能要等到 1.0 後再來試用比較好。剛才在 github 順便回答了 2 個問題,希望可以幫助到跟我有一樣困擾的人。
訂閱:
文章 (Atom)


