first_bs(int): batch size for the first scale in scales
divided_factor(int): ImageNet models down-sample images by a factor, ensure that width and height dimensions are multiples are multiple of devided_factor.
is_training(boolean): mode
"""
# min. and max. spatial dimensions
self.data_source=data_source
self.n_data_samples=len(self.data_source)
ifisinstance(scales[0],tuple):
width_dims=[i[0]foriinscales]
height_dims=[i[1]foriinscales]
elifisinstance(scales[0],int):
width_dims=scales
height_dims=scales
base_im_w=width_dims[0]
base_im_h=height_dims[0]
base_batch_size=first_bs
# Get the GPU and node related information
num_replicas=dist.get_world_size()
rank=dist.get_rank()
# adjust the total samples to avoid batch dropping