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

Training DINO #181

Closed wishforgood closed 1 year ago

wishforgood commented 1 year ago

What is the correct way for training a dino model?

I tried python tools/train_net.py --config-file projects/dino/configs/dino_r50_4scale_12ep.py like instructed in the doc, but got an error says TypeError: get_default_optimizer_params() got an unexpected keyword argument 'lr_factor_func'. I checked the code and found that dino_r50_4scale_12ep.py is really using get_default_optimizer_params(), which has not such an input.

rentainhe commented 1 year ago

What is the correct way for training a dino model?

I tried python tools/train_net.py --config-file projects/dino/configs/dino_r50_4scale_12ep.py like instructed in the doc, but got an error says TypeError: get_default_optimizer_params() got an unexpected keyword argument 'lr_factor_func'. I checked the code and found that dino_r50_4scale_12ep.py is really using get_default_optimizer_params(), which has not such an input.

It seems like your detectron2 is not the correct version, you should install d2 follow our official installation guide: https://detrex.readthedocs.io/en/latest/tutorials/Installation.html

which we keep the version of detectron2 fixed using github submodule @wishforgood

wishforgood commented 1 year ago

Sorry, I'm not able to install d2 following your guide, after installing that way, I run random codes and got an error like this

微信图片_20221231235008

It seems like that the c++ part failed to be compiled.

So I tried to install a fixed pre-compiled version of d2, which I thought was the newest one: https://github.com/facebookresearch/detectron2/releases/tag/v0.6

rentainhe commented 1 year ago

Sorry, I'm not able to install d2 following your guide, after installing that way, I run random codes and got an error like this

微信图片_20221231235008

It seems like that the c++ part failed to be compiled.

So I tried to install a fixed pre-compiled version of d2, which I thought was the newest one: https://github.com/facebookresearch/detectron2/releases/tag/v0.6

This is not the newest one, it's only the newest package~, maybe you should figure out how to install their latest code, our guide is one way

wishforgood commented 1 year ago

Sorry, I'm not able to install d2 following your guide, after installing that way, I run random codes and got an error like this 微信图片_20221231235008 It seems like that the c++ part failed to be compiled. So I tried to install a fixed pre-compiled version of d2, which I thought was the newest one: https://github.com/facebookresearch/detectron2/releases/tag/v0.6

This is not the newest one, it's only the newest package~, maybe you should figure out how to install their latest code, our guide is one way

OK, I understand. I will try again to compile it someway.

rentainhe commented 1 year ago

Sorry, I'm not able to install d2 following your guide, after installing that way, I run random codes and got an error like this 微信图片_20221231235008 It seems like that the c++ part failed to be compiled. So I tried to install a fixed pre-compiled version of d2, which I thought was the newest one: https://github.com/facebookresearch/detectron2/releases/tag/v0.6

This is not the newest one, it's only the newest package~, maybe you should figure out how to install their latest code, our guide is one way

OK, I understand. I will try again to compile it someway.

the other way is that you can try to find the specific pull request and add the code into your own local package~

wishforgood commented 1 year ago

No need to recompile? OK, that's a good news, thanks. I will try it.

rentainhe commented 1 year ago

No need to recompile? OK, that's a good news, thanks. I will try it.

Yes, it's just pytorch code, find the specific pr about adding lr_factor_func, and just add these code into your own local detectron2 package~