Coder Social home page Coder Social logo

eautodet's Introduction

EAutoDet

Implementation of EAutoDet, an efficient NAS method for Object Detection. Code is developed based on YOLOV5

Environment

The environment of this project is the same as YOLOv5. Also, you can build a singularity image by:

singularity build <name/of/image>.sig envs/singularity.def

Performance

We define four search spaces, denoted as EAutoDet-s (small), EAutoDet-m (mediun), EAutoDet-l (large), and EAutoDet-x (extra-large). We also train YOLOv5 from scratch and compare with our discovered models. FPS are evaluated on the Darknet platform, which is written in C and CUDA.

Model mAP(0.5:0.95) Params (M) FPS
YOLOv5-s 36.9 7.3 113
YOLOv5-m 43.9 21.4 88
YOLOv5-l 46.8 47.1 59
YOLOv5-x 49.1 87.8 43
EAutoDet-s 40.1 9.1 120
EAutoDet-m 45.2 28.1 70
EAutoDet-l 47.9 34.4 59
EAutoDet-x 49.2 86.0 41

Quick Start

How to search an architecture

You can search an EAutoDet-s on the 0-th GPU for 50 epochs by running the following codes:

bash scripts/search.sh 0

If you want to search on other spaces, you can change the value of cfg_file in scripts/bash.sh and run the above code.

If you want to search with a large batch size on multiple GPUs, run the following code to search on 4 GPUs:

bash scripts/search.sh 0 1 2 3

How to train the discovered architecture

After searching, the code will save the genotype of discovered architectures in the directory runs/train-$ID/exp/genotypes/, where $ID is the timestamp of your search process. Then you can evluate the discovered architecture by training the discovered architecture for 300 epochs from scratch. Run the following code to train on a single GPU.

bash scritps/full_train.sh 0

Notice that before running the above code, you should change $ID in scripts/full_train.sh as the timestamp of your search process.

If you want to train with a large batch sizei on multiple GPUs, run the following code to train on 4 GPUs:

bash scripts/full_train.sh 0 1 2 3

How to evaluate the trained model

You can the following code to test on the test set of COCO:

bash scripts/eval.sh 0

Then you can submit the results (json file) to COCO evaluation website

How to evaluate FPS

You can change the discovered architecture configuration (yaml file) to Darknet configuration and then test on Darknet platform, the codes are coming soon.

Citations

@article{EAutoDet,
  author    = {Xiaoxing Wang and
               Jiale Lin and
               Junchi Yan and
               Juanping Zhao and
               Xiaokang Yang},
  title     = {EAutoDet: Efficient Architecture Search for Object Detection},
  journal   = {CoRR},
  volume    = {abs/2203.10747},
  year      = {2022},
}

eautodet's People

Contributors

vicfigure avatar

Stargazers

Qiyu Zhang avatar  avatar  avatar  avatar Yongjie Shi avatar Shun Lu avatar PeiHsuan avatar  avatar  avatar zheng7 avatar Jungsub Lim avatar

Watchers

 avatar

eautodet's Issues

result type Float can't be cast to the desired output type long int

Traceback (most recent call last):
File "train_search.py", line 668, in
train(hyp, opt, device, tb_writer, wandb)
File "train_search.py", line 356, in train
architect.step(input_valid, target_valid)
File "/home/syj/lightweight/EAutoDet-master/architect.py", line 33, in step
self.backward_step(input_valid, target_valid)
File "/home/syj/lightweight/EAutoDet-master/architect.py", line 46, in backward_step
loss, loss_items = self.compute_loss(pred, target_valid.to(self.device)) # loss scaled by batch_size
File "/home/syj/lightweight/EAutoDet-master/utils/loss.py", line 117, in call
tcls, tbox, indices, anchors = self.build_targets(p, targets) # targets
File "/home/syj/lightweight/EAutoDet-master/utils/loss.py", line 211, in build_targets
indices.append((b, a, gj.clamp
(0, gain[3] - 1), gi.clamp
(0, gain[2] - 1))) # image, anchor, grid indices
RuntimeError: result type Float can't be cast to the desired output type long int

Reproduced result

Hi! I am interested in your paper. I run the code (search and retrain) following the Readme and achieve 33.3 mAP for EAutoDet-s. The batch size is 80 for searching (a single GPU) and 240 for training (four GPUs).

I am confused about the performance gap. It is appreciated if you can provide the batch size of your results or your suggestion.

Thank you!

[Question] How does the 'alpha' get updated by using register_buffer()?

As I know, variables introduced to the module by using register_buffer() are not get updated by optimizer.

So I wonder how the alphas registered as buffer could be updated ๐Ÿค”

For example, in Conv_search,

self.register_buffer('alphas', torch.autograd.Variable(1e-3*torch.randn(len(kd)), requires_grad=True))

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.