Giter VIP home page Giter VIP logo

Comments (23)

KingsonSingh avatar KingsonSingh commented on August 15, 2024

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.

skvravi108 avatar skvravi108 commented on August 15, 2024

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.

noelcodes avatar noelcodes commented on August 15, 2024

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.

leccyril avatar leccyril commented on August 15, 2024

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.

JayLee15 avatar JayLee15 commented on August 15, 2024

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.

leccyril avatar leccyril commented on August 15, 2024

@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.

JayLee15 avatar JayLee15 commented on August 15, 2024

@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.

leccyril avatar leccyril commented on August 15, 2024

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.

mking1011 avatar mking1011 commented on August 15, 2024

@JayLee15 @bassmaamn @leccyril

Did you solve this problem?

Could you check the file I modified?

Desktop.zip

from tensorflow-object-detection-api-tutorial-train-multiple-objects-windows-10.

simonegrazioso avatar simonegrazioso commented on August 15, 2024

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.

leccyril avatar leccyril commented on August 15, 2024

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.

leccyril avatar leccyril commented on August 15, 2024

@mking1011

it seems to be OK , what's happening when you check the eval on tensorboard ?

@simonegrazioso

it is what you see on eval board ?

from tensorflow-object-detection-api-tutorial-train-multiple-objects-windows-10.

simonegrazioso avatar simonegrazioso commented on August 15, 2024

@leccyril

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%).

@simonegrazioso

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.

Chloejay avatar Chloejay commented on August 15, 2024

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.

niyanthh87 avatar niyanthh87 commented on August 15, 2024

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.

keertika-j avatar keertika-j commented on August 15, 2024

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.

djalusic avatar djalusic commented on August 15, 2024

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.

Sangharsh-kamble avatar Sangharsh-kamble commented on August 15, 2024

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.

mehmetsoylu avatar mehmetsoylu commented on August 15, 2024

@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 avatar JayLee15 commented on August 15, 2024

@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.

mehmetsoylu avatar mehmetsoylu commented on August 15, 2024

@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.

SOTASHE avatar SOTASHE commented on August 15, 2024

@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.

devil1209 avatar devil1209 commented on August 15, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.