romroc / objdet_train_tensorflow_colab Goto Github PK
View Code? Open in Web Editor NEWGoogle Colab (Jupyter) notebook to retrain Object Detection Tensorflow model with custom dataset.
License: MIT License
Google Colab (Jupyter) notebook to retrain Object Detection Tensorflow model with custom dataset.
License: MIT License
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'
Can you help me with this?
The RAM is full with yellow blinker on it and it throws an error like this
"'I0905 12:46:06.927326 140626108987264 learning.py:768] Starting Queues.
2019-09-05 12:46:11.828411: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libcublas.so.10.0
2019-09-05 12:46:23.122746: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libcudnn.so.7
I0905 12:46:24.592570 140623126210304 supervisor.py:1099] global_step/sec: 0
^C"
input :
%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
!pip install object_detection
%cd ~/models/research
!protoc object_detection/protos/*.proto --python_out=.
import os
os.environ['PYTHONPATH'] += '/home/fresh1/Desktop/models/research'
!python3 setup.py build
!python3 setup.py install
%cd ~/models/research/slim
#!pip3 install -e
!export PYTHONPATH=$PYTHONPATH:pwd:pwd/slim
!python3 ~/root/models/research/object_detection/builders/model_builder_test.py
output :
/root/models/research/slim
python3: can't open file '/root/root/models/research/object_detection/builders/model_builder_test.py': [Errno 2] No such file or directory
When trying to run the notebook on google colab using Python 3 + GPU kernel, I get the error below. It looks like the correct folder has not been exported to the PATH
/root
Selecting previously unselected package libprotobuf10:amd64.
(Reading database ... 22298 files and directories currently installed.)
Preparing to unpack .../libprotobuf10_3.0.0-9.1ubuntu1_amd64.deb ...
Unpacking libprotobuf10:amd64 (3.0.0-9.1ubuntu1) ...
Selecting previously unselected package libprotoc10:amd64.
Preparing to unpack .../libprotoc10_3.0.0-9.1ubuntu1_amd64.deb ...
Unpacking libprotoc10:amd64 (3.0.0-9.1ubuntu1) ...
Selecting previously unselected package protobuf-compiler.
Preparing to unpack .../protobuf-compiler_3.0.0-9.1ubuntu1_amd64.deb ...
Unpacking protobuf-compiler (3.0.0-9.1ubuntu1) ...
Setting up libprotobuf10:amd64 (3.0.0-9.1ubuntu1) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Setting up libprotoc10:amd64 (3.0.0-9.1ubuntu1) ...
Setting up protobuf-compiler (3.0.0-9.1ubuntu1) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
/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'
I am getting this error:
[Errno 2] No such file or directory: '/root/datalab'
Please help
/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
ImportError: No module named object_detection.builders
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 .
Originally posted by @sam-ai in #3 (comment)
Last few days I have trying to do object detection for custom dataset. Problem is, it works for single class detection like given here eg. dog. I tried it with https://www.robots.ox.ac.uk/~vgg/data/pets/ and there is no bounding box appearing after inferencing the fine tuned model. When i do it for single class it works normally. What am I doing wrong?? I tried with different models from tensorflow zoo(ssd/faster rcnn) as suggested here tensorflow/models#2773 but nothing works for multiclass training.
MODEL used = 'faster_rcnn_inception_v2_coco_2018_01_28'
Link to my drive (made in a rush):https://drive.google.com/open?id=1G3zgSErQIsu1uF23R8_zvAk0-6eZKbsG
Please help...?
First of all let me say this is not an issue regarding your code, but I think you will have some suggestions to make. I am training custom object detector with ssd_mobilenet_v2_coco as the pre-trained model. For this I am following this tutorial : https://tensorflow-object-detection-api-tutorial.readthedocs.io/en/latest/index.html
But in the training section it crashed after about 700 steps. My train set has about 2000 images and test set has 50. The batch size is 24, which is the default value in the config file.
Have you faced any similar issues when training? Would like to hear your suggestions.
Hi,
%cd
sets /root
directory, not /content
. Is this a change in colab VM directories structure?os.mkdir('datalab')
is missing in the code?closed
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.