Zardinality / TF_Deformable_Net

Deformable convolution net on Tensorflow

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Batchsize issue

knmac opened this issue · comments

Is it possible to have more than one sample per batch? Data with batch size more than one are asserted in lib/rpn_msr/proposal_layer.py (line 67)

@knmac It is an issue left in long history. lib/rpn_msr/proposal_layer.py stems back to the original repo from rbgirshick. But other tf implementation(Faster-RCNN_TF and many downstream projects) generally did not use it as it is a caffe layer, they use proposal_layer_tf.py instead, which is a direct rewritten version of proposal_layer.py in tf.

Now let's get back to why batch_size more than one not supported. I will refer two related issues in rbgirshick's original repo: issue1, issue2. As these two issues point out, batch_size more than one is just not implemented and there is a fork that works with batch size more than one. Unfortunately, the fork change a caffe layer to do the work, while we use a tf one.

By far my advice is, either manually find all changes in proposal_layer.py of the working fork with respect to proposal_layer_tf.py(and possible many other scripts) and fix them, or split the feature batch to multiple single item batch before passing to the proposal_layer, proposal_target_layer and so on.

You might also want to look into many refactored works of mask r-cnn (such as this) that support multi-GPU training if you are looking for it.