Skip to content

Commit

Permalink
[MaskRCNN] padding bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
ppwwyyxx committed Jun 6, 2018
1 parent ba293da commit 3a0c5e9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ It's Yet Another TF high-level API, with __speed__, __readability__ and __flexib
some benchmark scripts.

2. Focus on __large datasets__.
+ [You don't need `tf.data`](http://tensorpack.readthedocs.io/tutorial/input-source.html#tensorflow-reader-cons).
It's unnecessary and painful to process data with a new language called TF.
Tensorpack helps you efficiently load large datasets (e.g. ImageNet) in __pure Python__ with autoparallelization.
+ [You don't usually need `tf.data`](http://tensorpack.readthedocs.io/tutorial/input-source.html#tensorflow-reader-cons).
Symbolic programming often makes data processing harder.
Tensorpack helps you efficiently process large datasets (e.g. ImageNet) in __pure Python__ with autoparallelization.

3. It's not a model wrapper.
+ There are too many symbolic function wrappers in the world. Tensorpack includes only a few common models.
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial/input-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ The disadvantage of TF reader is obvious and it's huge: it's __too complicated__

Unlike running a mathematical model, data processing is a complicated and poorly-structured task.
You need to handle different formats, handle corner cases, noisy data, combination of data.
Doing these require condition operations, loops, data structures, sometimes even exception handling.
Doing these requires condition operations, loops, data structures, sometimes even exception handling.
These operations are __naturally not the right task for a symbolic graph__.

Let's take a look at what users are asking for `tf.data`:
Expand Down
5 changes: 3 additions & 2 deletions examples/FasterRCNN/basemodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,11 @@ def resnet_fpn_backbone(image, num_blocks, freeze_c2=True):
assert len(num_blocks) == 4, num_blocks
with resnet_argscope():
chan = image.shape[1]
pad_base = maybe_reverse_pad(2, 3)
l = tf.pad(image, tf.stack(
[[0, 0], [0, 0],
maybe_reverse_pad(2, 3 + pad_shape2d[0]),
maybe_reverse_pad(2, 3 + pad_shape2d[1])]))
[pad_base[0], pad_base[1] + pad_shape2d[0]],
[pad_base[0], pad_base[1] + pad_shape2d[1]]]))
l.set_shape([None, chan, None, None])
l = Conv2D('conv0', l, 64, 7, strides=2, activation=BNReLU, padding='VALID')
l = tf.pad(l, [[0, 0], [0, 0], maybe_reverse_pad(0, 1), maybe_reverse_pad(0, 1)])
Expand Down

0 comments on commit 3a0c5e9

Please sign in to comment.