Commit 15b35d95 authored by Yuxin Wu's avatar Yuxin Wu

[FasterRCNN] disable cropsize bug and disable fork

parent d0cb0ede
...@@ -267,7 +267,7 @@ def get_eval_dataflow(): ...@@ -267,7 +267,7 @@ def get_eval_dataflow():
assert im is not None, fname assert im is not None, fname
return im return im
ds = MapDataComponent(ds, f, 0) ds = MapDataComponent(ds, f, 0)
ds = PrefetchDataZMQ(ds, 1) # ds = PrefetchDataZMQ(ds, 1)
return ds return ds
......
...@@ -306,6 +306,7 @@ def crop_and_resize(image, boxes, box_ind, crop_size): ...@@ -306,6 +306,7 @@ def crop_and_resize(image, boxes, box_ind, crop_size):
Returns: Returns:
n,C,size,size n,C,size,size
""" """
assert isinstance(crop_size, int), crop_size
@under_name_scope() @under_name_scope()
def transform_fpcoor_for_tf(boxes, image_shape, crop_shape): def transform_fpcoor_for_tf(boxes, image_shape, crop_shape):
""" """
......
...@@ -119,7 +119,7 @@ class Model(ModelDesc): ...@@ -119,7 +119,7 @@ class Model(ModelDesc):
with tf.name_scope('fg_sample_patch_viz'): with tf.name_scope('fg_sample_patch_viz'):
fg_sampled_patches = crop_and_resize( fg_sampled_patches = crop_and_resize(
image, fg_sampled_boxes, image, fg_sampled_boxes,
tf.zeros_like(fg_inds_wrt_sample, dtype=tf.int32), [300, 300]) tf.zeros_like(fg_inds_wrt_sample, dtype=tf.int32), 300)
fg_sampled_patches = tf.transpose(fg_sampled_patches, [0, 2, 3, 1]) fg_sampled_patches = tf.transpose(fg_sampled_patches, [0, 2, 3, 1])
tf.summary.image('viz', fg_sampled_patches, max_outputs=30) tf.summary.image('viz', fg_sampled_patches, max_outputs=30)
...@@ -308,7 +308,7 @@ if __name__ == '__main__': ...@@ -308,7 +308,7 @@ if __name__ == '__main__':
cfg = TrainConfig( cfg = TrainConfig(
model=Model(), model=Model(),
dataflow=get_train_dataflow(), data=QueueInput(get_train_dataflow()),
callbacks=[ callbacks=[
PeriodicTrigger(ModelSaver(), every_k_epochs=5), PeriodicTrigger(ModelSaver(), every_k_epochs=5),
# linear warmup # linear warmup
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment