parser.add_argument('--max-eval',type=int,help='Limit the number of scenes in the evaluation set.')
parser.add_argument('--full-scale',action='store_true',help='Evaluate on full images.')
parser.add_argument('--print-model',action='store_true',help='Print model and parameters on startup.')
parser.add_argument('--strategy',type=str,default='ddp',help='Strategy to use for parallelisation [ddp, dfsdp]')
args=parser.parse_args()
withopen(args.config,'r')asf:
...
...
@@ -128,8 +132,15 @@ if __name__ == '__main__':
print('Model created.')
ifworld_size>1:
model.encoder=DistributedDataParallel(model.encoder,device_ids=[rank],output_device=rank,find_unused_parameters=True)# Set find_unused_parameters to True because the ViT is not trained
model_encoder_ddp=DistributedDataParallel(model.encoder,device_ids=[rank],output_device=rank,find_unused_parameters=True)# Set find_unused_parameters to True because the ViT is not trained