IDEA-Research / detrex

detrex is a research platform for DETR-based object detection, segmentation, pose estimation and other visual recognition tasks.
https://detrex.readthedocs.io/en/latest/
Apache License 2.0
2.01k stars 209 forks source link

There is a lot of blank space #184

Closed ma3252788 closed 1 year ago

ma3252788 commented 1 year ago

When I use detrex for training, I got a lot of blanks:

image

ma3252788 commented 1 year ago

I changed several servers, all of which are like this

rentainhe commented 1 year ago

I changed several servers, all of which are like this

This is the logging info about loading pretrained weights, which will print the matched keys of your pretrained weights and models, I think it's a normal, all the unmatched keys will be logged after printing this with green and purple colors

ma3252788 commented 1 year ago

I changed several servers, all of which are like this

This is the logging info about loading pretrained weights, which will print the matched keys of your pretrained weights and models, I think it's a normal, all the unmatched keys will be logged after printing this with green and purple colors

I used the officially provided pre-trained models, as well as the COCO2017 dataset. There are very, very many of these empty lines, and since there are no automatic line breaks, I need to scroll with the mouse for a long time to see the beginning output content.

rentainhe commented 1 year ago

I changed several servers, all of which are like this

This is the logging info about loading pretrained weights, which will print the matched keys of your pretrained weights and models, I think it's a normal, all the unmatched keys will be logged after printing this with green and purple colors

I used the officially provided pre-trained models, as well as the COCO2017 dataset. There are very, very many of these empty lines, and since there are no automatic line breaks, I need to scroll with the mouse for a long time to see the beginning output content.

we will take a look into it and try to improve the logging function

ma3252788 commented 1 year ago

I changed several servers, all of which are like this

This is the logging info about loading pretrained weights, which will print the matched keys of your pretrained weights and models, I think it's a normal, all the unmatched keys will be logged after printing this with green and purple colors

I used the officially provided pre-trained models, as well as the COCO2017 dataset. There are very, very many of these empty lines, and since there are no automatic line breaks, I need to scroll with the mouse for a long time to see the beginning output content.

we will take a look into it and try to improve the logging function

I just looked at log.txt and I noticed that in the output of checkpoint, there are a lot of spaces in each line and each line has 14501 characters, which I think is the main reason for showing a lot of empty lines in the terminal.

image

But this problem does not exist when outputting the network structure, I think it can be outputted according to the network structure.

image

rentainhe commented 1 year ago

I changed several servers, all of which are like this

This is the logging info about loading pretrained weights, which will print the matched keys of your pretrained weights and models, I think it's a normal, all the unmatched keys will be logged after printing this with green and purple colors

I used the officially provided pre-trained models, as well as the COCO2017 dataset. There are very, very many of these empty lines, and since there are no automatic line breaks, I need to scroll with the mouse for a long time to see the beginning output content.

we will take a look into it and try to improve the logging function

I just looked at log.txt and I noticed that in the output of checkpoint, there are a lot of spaces in each line and each line has 14501 characters, which I think is the main reason for showing a lot of empty lines in the terminal.

image

But this problem does not exist when outputting the network structure, I think it can be outputted according to the network structure.

image

Yes, in detectron2, If the names of two nodes are similar, they will be merged into one line in order to simplify the output. This may lead to too much text in a single line, making it unable to be completely displayed. It's a good way to just print the nodes' name and not merge them, but which may need to hack the DetectionCheckpointer

YTEP-ZHI commented 1 year ago

I had the same problem. When loading weights with unmatched keys, the output log is filled with A LOT of blank spaces among those keys. Is there any way to solve that problem? @rentainhe

YTEP-ZHI commented 1 year ago

image

The unmatched keys in the logs are too difficult to read.

rentainhe commented 1 year ago

image

The unmatched keys in the logs are too difficult to read.

We will take a look into this logging info recently, the blanks means the matched keys actually, unmatched keys will be printed in other ways~

YTEP-ZHI commented 1 year ago

image The unmatched keys in the logs are too difficult to read.

We will take a look into this logging info recently, the blanks means the matched keys actually, unmatched keys will be printed in other ways~

Thanks,hope this issue could be addressed soon.

rentainhe commented 1 year ago

We have already fixed this issue in this PR: https://github.com/IDEA-Research/detrex/pull/203, which will be merged into main recently

Loading Checkpoint

image

There's no blank any more in this case (DINO-R50).

@ma3252788 @YTEP-ZHI

Note

We simply modified the detectron2.checkpoint.DetectionCheckpointer, but we did not set this checkpoint as the default one because there will be much more output in this case sometimes. After this PR is merged, you can try to update the tools/train_net.py by replacing the old one with the detrex version:

...
# from detectron2.checkpoint import DetectionCheckpointer
from detrex.checkpoint import DetectionCheckpointer
...
YTEP-ZHI commented 1 year ago

@rentainhe Thanks for your hard work.

rentainhe commented 1 year ago

I'm closing this issue, feel free to reopen it if needed~ @ma3252788 @YTEP-ZHI