RomRoc / objdet_train_tensorflow_colab

Google Colab (Jupyter) notebook to retrain Object Detection Tensorflow model with custom dataset.
MIT License
103 stars 78 forks source link

I cant install required packages #3

Open rrrtype opened 5 years ago

rrrtype commented 5 years ago

I did run Install required packages but,looks like /root fatal: destination path 'models' already exists and is not an empty directory. /root/models/research Traceback (most recent call last): File "object_detection/builders/model_builder_test.py", line 23, in from object_detection.builders import model_builder ModuleNotFoundError: No module named 'object_detection'

and I did %cd

!git clone --quiet https://github.com/tensorflow/models.git

!apt-get install -qq protobuf-compiler python-tk

!pip install -q Cython contextlib2 pillow lxml matplotlib PyDrive

!pip install -q pycocotools

%cd ~/models/research !protoc object_detection/protos/*.proto --python_out=.

import os os.environ['PYTHONPATH'] += ':/content/models/research/:/content/models/research/slim/' %cd ~/models/research !python setup.py build !python setup.py install %cd ~/models/research/slim !pip install -e !export PYTHONPATH=$PYTHONPATH:pwd:pwd/slim

%cd ~/models/research !python object_detection/builders/model_builder_test.py but,looks like

Traceback (most recent call last): File "object_detection/builders/model_builder_test.py", line 23, in from object_detection.builders import model_builder File "/usr/local/lib/python3.6/dist-packages/object_detection-0.1-py3.6.egg/object_detection/builders/model_builder.py", line 35, in from object_detection.models import faster_rcnn_inception_resnet_v2_feature_extractor as frcnn_inc_res File "/usr/local/lib/python3.6/dist-packages/object_detection-0.1-py3.6.egg/object_detection/models/faster_rcnn_inception_resnet_v2_feature_extractor.py", line 28, in from nets import inception_resnet_v2 ModuleNotFoundError: No module named 'nets'

sam-ai commented 5 years ago

Try This one with Python 2

%cd ~

!git clone --quiet https://github.com/tensorflow/models.git

!apt-get install -qq protobuf-compiler python-tk

!pip install -q Cython contextlib2 pillow lxml matplotlib PyDrive

!pip install -q pycocotools

%cd ~/models/research !protoc object_detection/protos/*.proto --python_out=.

!python setup.py build !python setup.py install

%cd slim !pip install -e .

%cd .. !python object_detection/builders/model_builder_test.py

sam-ai commented 5 years ago

facing issues while running tfrecord code:

!python ~/models/research/object_detection/dataset_tools/create_pet_tf_record.py --label_map_path=label_map.pbtxt --data_dir=. --output_dir=. --num_shards=1

ERROR

/root/datalab Traceback (most recent call last): File "/root/models/research/object_detection/dataset_tools/create_pet_tf_record.py", line 318, in tf.app.run() File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 125, in run _sys.exit(main(argv)) File "/root/models/research/object_detection/dataset_tools/create_pet_tf_record.py", line 271, in main label_map_dict = label_map_util.get_label_map_dict(FLAGS.label_map_path) File "/usr/local/lib/python2.7/dist-packages/object_detection-0.1-py2.7.egg/object_detection/utils/label_map_util.py", line 164, in get_label_map_dict label_map = load_labelmap(label_map_path) File "/usr/local/lib/python2.7/dist-packages/object_detection-0.1-py2.7.egg/object_detection/utils/label_map_util.py", line 138, in load_labelmap label_map.ParseFromString(label_map_string) google.protobuf.message.DecodeError: Error parsing message

@RomRoc any help will be great .

vighc commented 4 years ago

Try this, just change content into root

import os os.environ['PYTHONPATH'] += ':/root/models/research/:/root/models/research/slim/' !set PYTHONPATH=C:\root\models\research\slim !python object_detection/builders/model_builder_test.py

this worked for me