전공관련/Deep Learning

[MXNet] 데이터 리스트를 만들고 rec 파일로 만들어 보자

매직블럭 2022. 4. 1. 09:44

 

MXNet 프레임워크에서는 RecordIO 를 이용하여 학습에 사용되는 데이터의 리스트를 만들고

해당파일을 rec파일로 만들어서 학습에 사용한다

 

단순히 이미지를 순차적으로 읽어 오는 경우에 비해 학습에 걸리는 시간이 유의미하게 차이나기 때문에

필요한 경우 rec파일로 만들어서 사용하면 도움이 될 수 있다.

 


파일 변환에는 im2rec.py 파일을 이용하고 해당 파일은 공식 github에서 받을 수 있다.

https://github.com/apache/incubator-mxnet/blob/master/tools/im2rec.py

 

GitHub - apache/incubator-mxnet: Lightweight, Portable, Flexible Distributed/Mobile Deep Learning with Dynamic, Mutation-aware D

Lightweight, Portable, Flexible Distributed/Mobile Deep Learning with Dynamic, Mutation-aware Dataflow Dep Scheduler; for Python, R, Julia, Scala, Go, Javascript and more - GitHub - apache/incubato...

github.com

 

 

[make list]
사용법 : python im2rec.py [outputpath/title] [DBPATH] --recursive --list --num-thread 8
예시 : python im2rec.py ./output/output /home/user/database/train --recursive --list --num-thread 8


[make rec - train]
사용법 : python im2rec.py [outputpath/] [DBPath] --recursive --pass-through --pack-label --num-thread 8
예시 : python im2rec.py ./output/ /home/user/database/train --recursive --pass-through --pack-label --num-thread 8

[make rec - test]
사용법 : python im2rec.py [outputpath/] [DBPath] --recursive --pass-through --pack-label --no-shuffle --num-thread 8