net.cpp now allows zero-sized batches#1484
Conversation
|
Why not just remove https://github.com/BVLC/caffe/blob/dev/src/caffe/blob.cpp#L11? (And after #1486, probably do without this requirement for all dimensions.) One has to check to make sure this doesn't cause any problems, but most layers have a loop like https://github.com/BVLC/caffe/blob/dev/src/caffe/layers/conv_layer.cpp#L153, so they should just appropriately do nothing. |
|
@longjon, I'm not sure all layers correctly checks for |
|
@shelhamer Needs feedbacks by core members by 21 days |
|
@shelhamer @longjon can you give us a follow-up? |
|
closed, new PR is #2053 |
Implemented a way to allow zero-sized batches as discussed in #1448 with @sguada and @longjon (point 5).
The net now checks, before forwarding or backwarding anything, if some blob has num == 0, if so forward and backward are denyied and all subsequent layers are reshaped to avoid forward and bacward to those, too.
Actually the net doesn't allow a batch to have 0 size, but this could happen because #1482