Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why recognized as __ignore__:1.00 #206

Closed
EchizenG opened this issue Nov 7, 2019 · 16 comments
Closed

Why recognized as __ignore__:1.00 #206

EchizenG opened this issue Nov 7, 2019 · 16 comments

Comments

@EchizenG
Copy link

EchizenG commented Nov 7, 2019

Hello I just followed the steps(#70 (comment)) and training customers dataset guide. And then I got the objects were recognized as "ignore: 1.00" althrough I labeled them as box(some has 1 box some has multiple boxes).
And I can not delete the ignore label in label.txt file.
Can you help me with this?
Thank you

@EchizenG
Copy link
Author

EchizenG commented Nov 7, 2019

And the overlap objects were recognized as a whole object.

@dbolya
Copy link
Owner

dbolya commented Nov 10, 2019

I'm not familiar with the labelme process whatsoever, so can you explain your problem in more detail? What are the steps you have done so far (e.g., is this after training or what), and what's the issue you want to fix (i.e., is this ignore a class that you created that you want to remove or what)?

@EchizenG EchizenG reopened this Nov 11, 2019
@EchizenG
Copy link
Author

EchizenG commented Nov 11, 2019

I'm not familiar with the labelme process whatsoever, so can you explain your problem in more detail? What are the steps you have done so far (e.g., is this after training or what), and what's the issue you want to fix (i.e., is this ignore a class that you created that you want to remove or what)?

Thank you for your reply!

  1. I followed the step (Training with custom data #70 (comment)) to label the image. But I didn't label the same class object as box-1, box-2 and etc. I just labeled it as box.
  2. Fed the labeled dataset to train.py with batch_size=8 and backbone is Resnet50. It's 48 images in 640*480 and I have one GPU (Tesla V100) on super computer. I could use 2 but just tried one. The ETA was 7 days when epochs was 800,000. I adjusted it to 8000 and ETA is 2 hours. By the way, the ETA is almost same on RTX 2070.
  3. After 2 hours training, I used the eval.py to load the .pth file. The inference is like the title: recognized as ignore: 1.00 and the two boxes is a whole instance.

Therefore, there are three problems:

  1. What is the least epochs do we need generally? I guess 800,000 is much enough while the time is too long. This question might be case by case. But could you tell me your data that used in generally? Actually, all I want is just reducing the training time.
  2. I labeled the object as box (only this class). And the labels.txt is only 3 labels: ignore, background and box. But the inference is ignore instead of box. I am doubting that it should be labeled as box-1, box-2, and etc. I will give the result when I finish the trying.
  3. The output file's (.pth file) name is yolact_base_1333_2666.pth even I set the epoch as 8000. It should be yolact_base_8000_8000.pth, right?
    Some questions might looks silly. Thank you for your patient!

@EchizenG
Copy link
Author

EchizenG commented Nov 11, 2019

whole
instance

The upper one is that all instances were labeled as "box".
The bottom one is that instances were labeled as "box-1", "box-2" and "box-3"

I set the "max_iter" to 8000 while the output file name is "yolact_base_1332_2666.pth"

@dbolya
Copy link
Owner

dbolya commented Nov 12, 2019

Could it just be that your class names are configured incorrectly? It looks like it's attempting to detect the boxes in the second image. Is there any image where this ignore detection is supposed to be used? If not, then you can just rename whatever you have now as ignore to box.

What does your dataset's "class_names" property look like?

Side note: it looks like box-1, box-2, box-3 is the way to go. Others were confused about that, so it's good to know.

Then for your training issue, you have a small amount of data so you were correct in setting max iter to be low. However, you probably want to fine-tune instead of training from imagenet pretrained weights because of your limited data. You can see how here: #36.

Also, the file name is yolact_base_<epoch>_<iter>.pth. It looks like you were using 3 GPUs because if you set the iterations to 8000, it takes that number for 1 GPU. Then for 3 gpus it would end at 8000/3 = 2666. Make sure to export CUDA_VISIBLE_DEVICES=0 or whatever your single GPU index is to have it train with 1 GPU.

@EchizenG
Copy link
Author

I. CLASS NAME
For the class names, I only had one class "box". Therefore, I deleted all other class names except "ignore", "background" and "box"(not box-1, box-2). And I have never labeled anything as "ignore". I was trying to delete it from labels.txt(the file that labelme used to generate json file). But it occurs some error like following:

Traceback (most recent call last):
File "./labelme2coco.py", line 153, in
main()
File "./labelme2coco.py", line 73, in main
assert class_name == 'ignore'
AssertionError

ignore looks like necessory.

II. TRAINING ISSUE
I'll try this and report the result later. Thank you!

III. GPU ISSUE
Actually, I did use only 1 GPU. And export CUDA_VISIBLE_DEVICES=0 was excuted before training and the response didn't show that "Multiple GPUs detected! Turning off JIT."

@dbolya
Copy link
Owner

dbolya commented Nov 13, 2019

I. Can you share what your dataset config object looks like? (the one you defined in config.py). I think the problem might lie there and not with labelme, since my code can't output anything that's not defined in that object.


III. That's interesting. I'm not entirely sure how that's possible, but 1333 epochs is plenty anyway, so you probably don't have to worry about it.

@EchizenG
Copy link
Author

I.
OMG! I realize it when I submit the config.py to github. When I see labels.txt I just copy it to 'class_name' which means it value is {'ignore', 'background', 'box'}. I just find other class name doesn't include this 'useless' name. I'm retraining it right now. It should work!

Thank you anyway!
If it works, I will report it here and close it.

@dbolya
Copy link
Owner

dbolya commented Nov 13, 2019

Sounds good!

@EchizenG
Copy link
Author

No, it doesn't work. My config.py is here

Thank you

@dbolya
Copy link
Owner

dbolya commented Nov 18, 2019

Looks like you fell for a common Python pitfall! ('box') doesn't create a tuple with one element, it's just parenthesis around a string so it's the string itself. Thus your classes will be ['b', 'o', 'x']. To fix this change class names to ('box',).

I should probably change this to a list since many people are making the same mistake.

@EchizenG
Copy link
Author

It worked!
Thank you a lot!!!

@watertianyi
Copy link

@EchizenG

How to label a single category with labelme? After looking at the user-defined data set, there is no annotation naming method. For example, there is only one category in a graph: cat, cat, cat or cat1, cat2, Cat3 or cat-0, cat-1, cat-2

@EchizenG
Copy link
Author

@EchizenG

How to label a single category with labelme? After looking at the user-defined data set, there is no annotation naming method. For example, there is only one category in a graph: cat, cat, cat or cat1, cat2, Cat3 or cat-0, cat-1, cat-2

Labelme has exhaustive steps to lead you label. What you mentioned "cat, cat, cat or cat1, cat2, Cat3" is not single category, it is 3 categories. However, according to the labelme rules, "cat-0, cat-1, cat-2" represents three objects in one category. you can try this one.

@watertianyi
Copy link

@EchizenG
I only have a single category. For example, if the name of the category is cat and the label is cat-0, cat-1, cat-2, is there any basis or difference?

@EchizenG
Copy link
Author

@EchizenG
I only have a single category. For example, if the name of the category is cat and the label is cat-0, cat-1, cat-2, is there any basis or difference?

What do you mean basis or difference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants