提交 ea63f95f 编写于 作者: W Waleed Abdulla

Fix for multi-GPU training.

And cleaner path split in nucleus sample.
上级 2f9a6d59
......@@ -1910,7 +1910,7 @@ class MaskRCNN():
# TODO: can this be optimized to avoid duplicating the anchors?
anchors = np.broadcast_to(anchors, (config.BATCH_SIZE,) + anchors.shape)
# A hack to get around Keras's bad support for constants
anchors = KL.Lambda(lambda x: tf.constant(anchors), name="anchors")(input_image)
anchors = KL.Lambda(lambda x: tf.Variable(anchors), name="anchors")(input_image)
else:
anchors = input_anchors
......
......@@ -226,7 +226,8 @@ class NucleusDataset(utils.Dataset):
"""
info = self.image_info[image_id]
# Get mask directory from image path
mask_dir = os.path.join(info["path"].split("/images/")[0], "masks")
mask_dir = os.path.join(os.path.dirname(os.path.dirname(path)), "masks")
# Read mask files from .png image
mask = []
for f in next(os.walk(mask_dir))[2]:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册