1

I have used im2rec.py to convert "caltech101 images" into record io format:

I have created "caltech.lst" succesfully using os.system('python %s/tools/im2rec.py --list=1 --recursive=1 --shuffle=1 data/caltech data/101_ObjectCategories'%MXNET_HOME) Then, when I run this : os.system("python %s/tools/im2rec.py --train-ratio=0.8 --test-ratio=0.2 --num-thread=4 --pass-through=1 data/caltech data/101_ObjectCategories"%MXNET_HOME) I have this error : attributeError:'module' object has no attribute 'MXIndexedRecordIO' Please, someone has an idea to fix this error ? Thanks in advance.

Environment info

Operating System:Windows 8.1

MXNet version:0.9.5

2 Answers2

1

If I have found the right version of im2rec.py then the program is failing at one of the two calls that look like this:

record = mx.recordio.MXIndexedRecordIO(...)

That looks very much as if the code you are running is expecting a different version of mxnet from the one you have installed. The message is telling you that there isn't a class/function called MXIndexedRecordIO in module mxnet.recordio.

BoarGules
  • 16,440
  • 2
  • 27
  • 44
  • I have used tools/im2rec.py included in mxnet.0.9.5 package – user3824903 May 25 '17 at 13:48
  • I'm no `mxnet` expert. I'm just explaining what the message means. – BoarGules May 25 '17 at 14:04
  • Thank you @BoarGules. I have tested other versions of mxnet and i had the same error :( – user3824903 May 25 '17 at 14:12
  • That's probably some python binding error on window. Did you try the im2rec binary? Does it work for your case? You can follow the tutorial here: http://mxnet.io/how_to/recordio.html?highlight=im2rec – eric-haibin-lin May 26 '17 at 17:05
  • Hi, i don't have a bin repository on my mxnet package to run this: ./bin/im2rec image.lst image_root_dir output.bin resize=256 – user3824903 Jun 01 '17 at 08:58
  • @eric-haibin-lin can you please explain me by a short example how to use im2rec binany.. – user3824903 Jun 06 '17 at 13:32
  • @user3824903 the binary should be there after mxnet is compiled from source. Which version of mxnet are you using? How did you install mxnet? – eric-haibin-lin Jun 06 '17 at 16:02
  • Hi @eric-haibin-lin,I use MXNet version:0.9.5. I think that i have installed Mxnet successfully because running "import mxnet as mx" doesn't give an error and also i have converted my data to ".lst file" successfully. – user3824903 Jun 08 '17 at 09:28
  • Hi @eric-haibin-lin You were right, I installed mxnet incorrectly, it was missing .dll files (mingw64 and OpenBlas). now, the error has disappeared. Thank you for your help. – user3824903 Jun 15 '17 at 10:44
0

@user3824903 I think to create a bin directory, you have to compile MXNet from source with option USE_OPENCV=1

  • @ Roshani Nagmote What did you mean "from Source" please? can you give me an example with the line command to use. – user3824903 Jun 08 '17 at 10:35
  • I meant cloning mxnet repository then, running this command: "make -j USE_OPENCV=1" in mxnet repo. I haven't tried it on Windows though. Works fine on Mac – Roshani Nagmote Jun 08 '17 at 17:48