Comments (23)
I trained two models with 14 classes and 6 classes, but after training both model it recognize only 1 class.
Did any one finds the solution?
Please share !!
Thank you !!!
from tensorflow-object-detection-api-tutorial-train-multiple-objects-windows-10.
I trained on 7 classes, But after training the model it is able to recognize only 1 class.
Can any one suggest to detect multiple classes.
from tensorflow-object-detection-api-tutorial-train-multiple-objects-windows-10.
I had this problem before, then I found the solution is just the naming of the folders.
Check your faster_rcnn_xxxxxx.config file, all path is pointing to the correct folder names.
Example : "C:/tensorflow1/models/research/object_detection/
Not : "C:/tensorflow1/models_new/research/object_detection/
If you have renamed your folders (for whatever reason), then you had to rename your codes pointing to the correct folder names. Else it will continue to point to Edie's old path which is only classifying 6x items or 1x class by coincidence your 1x class is one of Edje's cards.
Go check your paths.
from tensorflow-object-detection-api-tutorial-train-multiple-objects-windows-10.
you have to modify label.pbtxt file and model training config file and generate_tf.py file
from tensorflow-object-detection-api-tutorial-train-multiple-objects-windows-10.
I have modified label.pbtxt file and model training config file and generate_tf.py file. But it recognize only 1 class. Did any one finds the solution?
from tensorflow-object-detection-api-tutorial-train-multiple-objects-windows-10.
@JayLee15 did you modify the pipeline.config too ? there is the number class to specify too
from tensorflow-object-detection-api-tutorial-train-multiple-objects-windows-10.
@leccyril Yes, I have modified the number class in pipeline.config, but it recognizes only 1 class.
from tensorflow-object-detection-api-tutorial-train-multiple-objects-windows-10.
what sample training did you use ? coco or pet detection ? maybe you can share your configuration files
generate tf record, label.pbtxt and the model configuration file
2 solutions, either you have somewhere 1 class configured
or you have only few pictures for the second class
did you launch the train and eval and follow it on tensorboard ?
from tensorflow-object-detection-api-tutorial-train-multiple-objects-windows-10.
@JayLee15 @bassmaamn @leccyril
Did you solve this problem?
Could you check the file I modified?
from tensorflow-object-detection-api-tutorial-train-multiple-objects-windows-10.
Did anyone found a solution? It's like impossible to train multi-class object detection. With only one class I had no problem. If I want to train faster_rcnn to detect two different classes, e.g. car and person, it can detect only one of this with good accuracy, and which object can detect (of the two classes) changes randomly during the training steps (example: step 1000 it detect only cars, step 2000 only person, step 3000 cars, step 4000 cars, step 5000 person, etc..).
Obiously my dataset is balanced (1400 images for the first class, 1550 for the second one).
from tensorflow-object-detection-api-tutorial-train-multiple-objects-windows-10.
there is no problem to train with multi classes just fill files i've mentionned before
from tensorflow-object-detection-api-tutorial-train-multiple-objects-windows-10.
it seems to be OK , what's happening when you check the eval on tensorboard ?
it is what you see on eval board ?
from tensorflow-object-detection-api-tutorial-train-multiple-objects-windows-10.
there is no problem to train with multi classes just fill files i've mentionned before
the files are all filled, otherwise there will be only one class detected and always the same one. Indeed, I detect both classes, rarely together, with very low accuracy when trained together. If i train the two classes separately, I have a good precision (50-55%).
it is what you see on eval board ?
Exactly.
Can u send me a link to your working dataset + generate tf record + label.pbtxt + model configuration file? Maybe there's a small error, even if I didn't change anything on the faster rcnn config file.. only number of classes. Label.pbtxt and generate tf record are ok, i check the tfrecords.
from tensorflow-object-detection-api-tutorial-train-multiple-objects-windows-10.
I have the same problem, the output just return one class, can someone advised me is I shouldn't write this in the code
with tf.Session() as sess:
for _image, _image_name in zip(_images,_image_names):
_image_expanded = np.expand_dims(_image, axis=0)
image_tensor = tf.get_default_graph().get_tensor_by_name('image_tensor:0')
scores= g1.get_tensor_by_name('detection_scores:0')
classes= g1.get_tensor_by_name('detection_classes:0')
(scores, classes) = sess.run([scores, classes],
feed_dict={image_tensor:_image_expanded})
for score, cls in zip(scores, classes):
score = score[0]
cls = cls[0]
_results.append({"name":_image_name, "pred_prob":score, "class_name":cls})
print(score, cls)
return _results
I take the last one as the model output
from tensorflow-object-detection-api-tutorial-train-multiple-objects-windows-10.
In my case it was in label_map.pbtxt the label name i had given was "Car" where in annotation it was "car" check the annotation label and write accordingly as label_map.pbtxt is case Sensitive
from tensorflow-object-detection-api-tutorial-train-multiple-objects-windows-10.
While converting the files from xml to csv , did you mention all the labels properly ?
from tensorflow-object-detection-api-tutorial-train-multiple-objects-windows-10.
According to this link, the filenames have to be shuffled inside the generate_tfrecords.py in order to properly train the model to detect multiple classes.
from tensorflow-object-detection-api-tutorial-train-multiple-objects-windows-10.
you have to check labelmap file ie. .pbtxt files. it has id number for each label. also while creating .record file need to be assign this labels in code
from tensorflow-object-detection-api-tutorial-train-multiple-objects-windows-10.
@JayLee15 @bassmaamn @leccyril @bassmaamn i have the same problem with yours. Did you solved your problem? If you solved it, how did you solved it? Can you please explain to me?
from tensorflow-object-detection-api-tutorial-train-multiple-objects-windows-10.
@JayLee15 @bassmaamn @leccyril @bassmaamn i have the same problem with yours. Did you solved your problem? If you solved it, how did you solved it? Can you please explain to me?
In my case, all categories of images are very similar. I increase the parameter 'second_stage_classification_loss_weight' and retrain to solve this problem.
from tensorflow-object-detection-api-tutorial-train-multiple-objects-windows-10.
@JayLee15 i am new on object detection so i dont know how to do that. How do i increase my 'second_stage_classification_loss_weight' ?
from tensorflow-object-detection-api-tutorial-train-multiple-objects-windows-10.
@mehmetsoylu I'm facing the same problem.. I have 5 classes but my model only detect the first class
from tensorflow-object-detection-api-tutorial-train-multiple-objects-windows-10.
i trained the object detection model for 13 classes using ssd mobilenetv2 but it is always predicting one class which has the lowest number of images and i have also checked the label map and annnotations files. can anyone could suggest something here
from tensorflow-object-detection-api-tutorial-train-multiple-objects-windows-10.
Related Issues (20)
- module has no attribute 'return_coordinates'
- Step 5b: How to change the files, if you use the newer (TF2) ssd_mobilenet_v2_fpnlite_320x320_coco17_tpu-8
- ImportError: cannot import name 'resnet' from 'tensorflow.python.keras.applications
- TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
- No module named 'nets' HOT 1
- NotImplementedError: Cannot convert a symbolic Tensor (cond_2/strided_slice:0) to a numpy array.
- 2f the path C:\tensorflow1\models\research cannot found setup.py HOT 1
- UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc1 in position 97: invalid start byte
- Train using images instead of tfrecord?
- TypeError: can't pickle _thread.RLock objects
- object_detection_tutorial.ipynb HOT 2
- Part 4:python generate_tfRecord.py --csv_input=images\ train_allags.csv --image_dir=images\train --output_path=train HOT 1
- raise ValueError('You must supply the path to save to with --output_file') ValueError: You must supply the path to save to with --output_file HOT 1
- raise ValueError('You must supply the path to save to with --output_file') ValueError: You must supply the path to save to with --output_file
- Files missing HOT 2
- mAP score HOT 1
- How to convert .pb model file to .tflite to use in App Mobile (Android) HOT 1
- ModuleNotFoundError: No module named 'tensorflow.compat' HOT 1
- problem with running python train.py --logtostderr --train_dir=training/ --pipeline_config_path=training/faster_rcnn_inception_v2_pets.config
- Does it works for intel gpu training?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tensorflow-object-detection-api-tutorial-train-multiple-objects-windows-10.