How to change SyncBatchNorm

i want to try the model on windows which is not supported to the distrubution. And i change the
net = torch.nn.SyncBatchNorm.convert_sync_batchnorm(net) into
net = torch.nn.BatchNorm2d(net)
but i got a error which is “TypeError: new(): data must be a sequence (got DeepV3PlusHANet)”.
And what should i do to run the code on windows, and how to change SyncBatchNorm with BatchNorm2d?

If you don’t want to use SyncBatchNorm you could just remove the convert_sync_batchnorm call and keep the original nn.BatchNorm*D layers.
From the docs:

Helper function to convert all BatchNorm*D layers in the model to torch.nn.SyncBatchNorm layers.

did i need to remove other code?
can SyncBatchNorm can replace the BatchNorm2D?

If you see other usages of any SyncBatchNorm calls, I would remove them as well.
Yes, convert_sync_batchnorm converts the nn.BatchNorm*D layers to their sync-equivalent.
If you don’t want to use this, just keep the model as it is without calling any SyncBatchNorm functions and it will use the standard nn.BatchNorm*D layers.

it sitll don’t work, i got the same error after removing the convert_sync_batchnorm.

Could you post an executable code snippet, so that we could have a look at this error?

Sorry the code is complex and i couldn’t give you a code snippet. You can get the rar file from this, just run the and may be you can get this error.
i use windows 10 and pytorch 1.4.0. Thank you so much.

Could you try to slim down the code and post it here, please?
Alternatively, could you create a gist on GitHub and post the link here?