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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
from __future__ import print_function
This file has been truncated. show original
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.
VIshaal
1 Like