You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2020/06/10 14:30:16 UTC

[GitHub] [incubator-tvm] AlexeyAB opened a new issue #5765: Feature-request: State-of-art Yolo v4 Detector

AlexeyAB opened a new issue #5765:
URL: https://github.com/apache/incubator-tvm/issues/5765


   Feature-request: State-of-art **Yolo v4** Detector
   
   * paper: https://arxiv.org/abs/2004.10934
   * source code: https://github.com/AlexeyAB/darknet
   * cfg-file Yolov4: https://github.com/AlexeyAB/darknet/blob/master/cfg/yolov4.cfg
   * weights-file Yolov4: https://drive.google.com/open?id=1cewMfusmPjYWbrnuJRuKhPMwRe_b9PaT
   
   ----
   
   Required features for YOLOv4:
   
   1. Mish-activation:
   ```cpp
   __device__ float mish_yashas(float x)
   {
       float e = __expf(x);
       if (x <= -18.0f)
           return x * e;
   
       float n = e * e + 2 * e;
       if (x <= -5.0f)
           return x * __fdividef(n, n + 2);
   
       return x - 2 * __fdividef(x, n + 2);
   }
   ```
   
   2. Eliminate grid sensitivity - by using scale_x_y= parameter from [yolo] layer in cfg-file (by default use scale_x_y=1.0 if the value is not set in cfg file)
   we should use:
   ```cpp
   const float x_tmp = logistic_activate(srcData[box_index + 0]) * scale_x_y - (scale_x_y - 1) / 2;
   const float y_tmp = logistic_activate(srcData[box_index + 1]) * scale_x_y - (scale_x_y - 1) / 2;
   dstData[box_index + 0] = (x + x_tmp)) / cols;
   dstData[box_index + 1] = (y + y_tmp)) / rows;
   ```
   instead of **(this code isn't from TVM)**:
   ```cpp
    dstData[box_index + 0] = (x + logistic_activate(srcData[box_index + 0])) / cols; 
    dstData[box_index + 1] = (y + logistic_activate(srcData[box_index + 1])) / rows; 
   ```
   
   ----
   
   Accuracy/speed comparison with other detectors on MS COCO dataset.
   
   ![comparison_gpus](https://user-images.githubusercontent.com/4096485/84280311-cd11b300-ab3f-11ea-9262-f59f7f12f359.png)
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-tvm] siju-samuel commented on issue #5765: Feature-request: State-of-art Yolo v4 Detector

Posted by GitBox <gi...@apache.org>.
siju-samuel commented on issue #5765:
URL: https://github.com/apache/incubator-tvm/issues/5765#issuecomment-642084669


   @AlexeyAB Thanks for the YoloV4 paper. the output is impressive.
   Few weeks back I already tried integrating this to tvm. In tvm we use 
   `network *load_network(char *cfg, char *weights, int clear)` api for loading the network and weights.
   But i found that this api takes more than 16GB RAM and due to this high memory issue the loading is failing. But when i run `./darknet detector` for yolov4 the RAM usage is less. Any possible reason you could think of?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-tvm] AlexeyAB commented on issue #5765: Feature-request: State-of-art Yolo v4 Detector

Posted by GitBox <gi...@apache.org>.
AlexeyAB commented on issue #5765:
URL: https://github.com/apache/incubator-tvm/issues/5765#issuecomment-642102804


   @siju-samuel Try to use `network *load_network_custom(char *cfg, char *weights, int clear, int batch)`
   And set `batch=1`.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-tvm] siju-samuel commented on issue #5765: Feature-request: State-of-art Yolo v4 Detector

Posted by GitBox <gi...@apache.org>.
siju-samuel commented on issue #5765:
URL: https://github.com/apache/incubator-tvm/issues/5765#issuecomment-642114545


   @AlexeyAB `load_network_custom` with `batch=1` memory is ok.  I will do the rest.  I think the `load_network` api is allocating memory for training as well. Thanks.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-tvm] zhiics commented on issue #5765: Feature-request: State-of-art Yolo v4 Detector

Posted by GitBox <gi...@apache.org>.
zhiics commented on issue #5765:
URL: https://github.com/apache/incubator-tvm/issues/5765#issuecomment-723192392


   Gentle ping @siju-samuel @AlexeyAB Is there any update the support of Darknet Yolo V4? Thanks.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-tvm] siju-samuel edited a comment on issue #5765: Feature-request: State-of-art Yolo v4 Detector

Posted by GitBox <gi...@apache.org>.
siju-samuel edited a comment on issue #5765:
URL: https://github.com/apache/incubator-tvm/issues/5765#issuecomment-642084669


   @AlexeyAB Thanks for the YoloV4 paper. the output is impressive.
   Few weeks back I already tried integrating this to tvm. In tvm we use 
   `network *load_network(char *cfg, char *weights, int clear)` api for loading the network and weights.
   But i found that this api takes more than 16GB RAM and due to this high memory issue the loading is failing. But when i run `./darknet detector` for yolov4 the RAM usage is less. Any possible reason you could think of?
   I used latest code to build libdarknet.so from  https://github.com/AlexeyAB/darknet


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org