Im2rec.py: error: unrecognized arguments TRUE

I want create .rec file (ubuntu 18)
So i have im2rec.py
then traim with .lst
i do so

python /home/Downloads/im2rec.py /home/Downloads/train ’ --center-crop True --resize 224 --pack-label True
and then get this error
im2rec.py: error: unrecognized arguments TRUE
How to fix it?

pencv@opencv-virtual-machine:~$ python /home/opencv/Downloads/im2rec.py /home/opencv/train . --resize 224 --pack-label True
usage: im2rec.py [-h] [–list] [–exts EXTS [EXTS …]] [–chunks CHUNKS]
[–train-ratio TRAIN_RATIO] [–test-ratio TEST_RATIO]
[–recursive] [–no-shuffle] [–pass-through]
[–resize RESIZE] [–center-crop] [–quality QUALITY]
[–num-thread NUM_THREAD] [–color {-1,0,1}]
[–encoding {.jpg,.png}] [–pack-label]
prefix root
im2rec.py: error: unrecognized arguments: True

my file taken from , i didn’t edit it

You just have to specify the flag - no need to include True. This will work for your first example:

python /home/Downloads/im2rec.py /home/Downloads/train --center-crop --resize 224 --pack-label

If not specified, then it’s taken to be false.

:slight_smile:
VIshaal

1 Like