models icon indicating copy to clipboard operation
models copied to clipboard

Problem with newest version

Open usamahjundia opened this issue 8 years ago • 6 comments

I am omitting the obligatory format because this has nothing to do with them.

I am working with the newest version, where train.py is no longer used

The thing is, when i tried to run the training with model_main.py, with this exact command:

python model_main.py \
  --pipeline_config_path=data/ssd_inception_v2_pets.config \
  --model_dir=training \
  --num_train_steps=100000 \
  --num_eval_steps=4000 \
  --alsologtostderr

it gave me errors because apparently, i need to install pycocotools and the code was meant for python 2

Is it possible to decouple pycocotools from the training code, and update the code to be suitable for both python 2 and 3 ?

Thank you.

usamahjundia avatar Jul 18 '18 09:07 usamahjundia

Running it from the research dir fixed that issue for me. The current code has syntax that is not compatible with python 3. I haven't tried changing that, but it might work. I think its mostly print statements that cause an issue.

MonkeyWithAComputer avatar Jul 18 '18 16:07 MonkeyWithAComputer

I was able to install pycocotools with and make the necessary changes to run in python3. pycocotools was fine for python3 for me when installed and I used 2to3 on models/research/object_detection/utils/object_detection_evaluation.py and models/research/object_detection/model_lib.py After that everything seemed to work ok.

cbolles avatar Jul 18 '18 17:07 cbolles

@jch1 - more py2/3 compatibility questions.

karmel avatar Jul 18 '18 22:07 karmel

as a quick fix, i did what @skagraDragneel suggested. Others having the same problem would find it a good temporary fix.

Thanks everyone!

usamahjundia avatar Jul 19 '18 03:07 usamahjundia

commant line 26 'from object_detection import eval_util' in model_lib.py if you do not need eval operations for python 2 to 3, reference https://github.com/EdjeElectronics/TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10/issues/11

yuezhilanyi avatar Aug 01 '18 00:08 yuezhilanyi

Closing this issue since workaround has been provided. Feel free to reopen if the issue still persists. Thanks!

ymodak avatar Nov 09 '18 21:11 ymodak