简体   繁体   中英

model_main.py file is using Python2.7 instead of Python3

I'm currently using python3 to run model_main.py file. I followed each step to install object_detection api

I've made sure that each command is run with a python3 prefix but after running the command:

python3 model_main.py --logtostderr --train_dir=custom1/training --pipeline_config_path=hand_inference_graph/pipeline.config

I'm getting an error: ImportError: /home/abrar/.local/lib/python2.7/site-packages/tensorflow/models/research/pycocotools/_mask.so: undefined symbol: _Py_ZeroStruct

The model_main.py file is using python2.7 every time I run the command.

offhand, I'd say that somehow /home/abrar/.local/lib/python2.7/site-packages/tensorflow/models/research/pycocotools is being added to your path which, by name, implies a directory full of python2.7 stuff. Try adding:

import sys
print(sys.path)

to the top of your script to determine what locations are being searched for modules. If the pycocotools directory is being added somehow, you'll need to either remove it from your path or find out where it's being added and stopping it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM