from mask_rcnn.ops import postprocess_ops from mask_rcnn.ops import roi_ops from mask_rcnn.ops import spatial_transform_ops from mask_rcnn.ops import training_ops from mask_rcnn.utils.logging_formatter import logging from mask_rcnn.utils.distributed_utils import MPI_is_distributed from mask_rcnn.utils.distributed_utils import MPI_local_rank from mask_rcnn.utils.meters import StandardMeter from mask_rcnn.utils.metric_tracking import register_metric from mask_rcnn.utils.lazy_imports import LazyImport hvd = LazyImport("smdistributed.dataparallel.tensorflow") MODELS = dict() def create_optimizer(learning_rate, params): """Creates optimized based on the specified flags.""" optimizer = tf.compat.v1.train.MomentumOptimizer( learning_rate, momentum=params['momentum']) if MPI_is_distributed(): optimizer = hvd.DistributedOptimizer( optimizer, name=None, device_dense='/gpu:0',
from mask_rcnn.ops import postprocess_ops from mask_rcnn.ops import roi_ops from mask_rcnn.ops import spatial_transform_ops from mask_rcnn.ops import training_ops from mask_rcnn.utils.logging_formatter import logging from mask_rcnn.utils.distributed_utils import MPI_is_distributed from mask_rcnn.utils.distributed_utils import MPI_local_rank from mask_rcnn.utils.meters import StandardMeter from mask_rcnn.utils.metric_tracking import register_metric from mask_rcnn.utils.lazy_imports import LazyImport hvd = LazyImport("horovod.tensorflow") MODELS = dict() def create_optimizer(learning_rate, params): """Creates optimized based on the specified flags.""" optimizer = tf.compat.v1.train.MomentumOptimizer( learning_rate, momentum=params['momentum']) if MPI_is_distributed(): optimizer = hvd.DistributedOptimizer( optimizer, name=None, device_dense='/gpu:0',