最近在学习使用MXNet,train_mnist.py可以正常跑,但是由于服务器无法联网,imagenet的数据集无法从网上下载,只好自己下载了JPEG类型的数据集,然后参考MXNet的官方文档,学习怎么转化为MXNet的文件格式rec。
以下为官方文档内容[mxnet/example/image-classification/README.md]
Prepare Datasets
The recommended data format is RecordIO, which concatenates multiple examples into seekable binary files for better read efficiency. We provide a tool im2rec.py
located in tools/
to convert individual images into .rec
files.
在MXNet中提供了一个工具 im2rec.py
将原始图片转化为.rec
文件, im2rec.py
在tools/
下。
For a simple tutorial, assume all images are stored as individual image files such as .png
or .jpg
, and images belonging to the same class are placed in the same directory. All these class directories are