Darknet: Feature Request: To be able to specify the random resize factor upper and lower limits.

Created on 23 Feb 2020  路  5Comments  路  Source: AlexeyAB/darknet

Currently, to enable random growth/shrink, you can put "random=1" into the Yolo layers. This enables random growth/shrinkage of the input image by a factor of 0.6 to 1.4 as an additional augmentation.

I usually don't use this because this increases the GPU VRAM requirements substantially (by a factor of almost 2?). If I were able to put "random=0.6, 1.25" indicating that the input image size should vary at random between 0.6x and 1.25x then I could tune the upper limit of the random resizes to match my VRAM and get to use this feature.

For backward compatability, "random=1" could retain it's original meaning, but two numbers could be interpreted as limits. What do you think?

want enhancement

Most helpful comment

Hi,

May be yes, I will add low and high boundary for random, i.e.random_min=0.6 random_max=1.2


currently there is

  • random=0 - disabled
  • random=1 - enabled [/1.4 - x1.4], i.e. [0.7 - 1.4]
  • random=1.25 - enabled [/1.25 - x1.25], i.e. [0.8 - 1.25]

If CBN will work successfully, then you will be able to set mini_batch size = 1 i.e. batch=64 subdivisions=64, to reduce GPU-memory usage.
https://github.com/AlexeyAB/darknet/issues/4386#issuecomment-589754020

All 5 comments

Hi,

May be yes, I will add low and high boundary for random, i.e.random_min=0.6 random_max=1.2


currently there is

  • random=0 - disabled
  • random=1 - enabled [/1.4 - x1.4], i.e. [0.7 - 1.4]
  • random=1.25 - enabled [/1.25 - x1.25], i.e. [0.8 - 1.25]

If CBN will work successfully, then you will be able to set mini_batch size = 1 i.e. batch=64 subdivisions=64, to reduce GPU-memory usage.
https://github.com/AlexeyAB/darknet/issues/4386#issuecomment-589754020

I actually didn't know about the 1.25 option, for me that would be sufficient to be getting on with. The customizable limits would be "nice" but not such a priority of mine, given the 1.25 option.

You can set any value

random=<costom_value> - enabled [/ - x]

excellent!

Would you mind explaining why random=1 can appear in the [yolo] layers, rather than the [net] layers?

If you are essentially resizing the network to a higher or lower resolution, that change is not specific to the [yolo] layer?

What would happen if you had different values or random in the different yolo layers?

If you are essentially resizing the network to a higher or lower resolution, that change is not specific to the [yolo] layer?

I have the same question )
May be better to use random= in the [net] section. And if there are used both ways, then the random= in the [net] has higher priority.

What would happen if you had different values or random in the different yolo layers?

Just used the random=value from the last [yolo] layer.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hemp110 picture hemp110  路  3Comments

Greta-A picture Greta-A  路  3Comments

Mididou picture Mididou  路  3Comments

qianyunw picture qianyunw  路  3Comments

zihaozhang9 picture zihaozhang9  路  3Comments