Closed yashveerjain closed 3 years ago
You may try to change the SyncBN to BN in your configfile
You may try to change the SyncBN to BN in your configfile
This works perfectly fine for me , Thanks
change in this file psenet_r50_fpnf_600e_icdar2015.py
Change 'SyncBn' to 'BN',
model = dict( type='PSENet', pretrained='torchvision://resnet50', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=-1, norm_cfg=dict(type='SyncBN', requires_grad=True)
model = dict( type='PSENet', pretrained='torchvision://resnet50', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=-1, norm_cfg=dict(type='BN', requires_grad=True)
where is the file?
You may try to change the SyncBN to BN in your configfile
This works perfectly fine for me , Thanks change in this file
psenet_r50_fpnf_600e_icdar2015.py
Change 'SyncBn' to 'BN',
model = dict( type='PSENet', pretrained='torchvision://resnet50', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=-1, norm_cfg=dict(type='SyncBN', requires_grad=True)
Changed code
model = dict( type='PSENet', pretrained='torchvision://resnet50', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=-1, norm_cfg=dict(type='BN', requires_grad=True)
where is the file ?
where is the file?
can you solved?
Hello, on my side, I managed to run on CPU by changing the SyncBN
by BN
in the configuration:
config = "configs/pspnet/pspnet_r50-d8_512x1024_40k_cityscapes.py"
config = mmcv.Config.fromfile(config)
config["norm_cfg"]["type"] = "BN"
config["model"]["backbone"]["norm_cfg"]["type"] = "BN"
config["model"]["decode_head"]["norm_cfg"]["type"] = "BN"
config["model"]["auxiliary_head"]["norm_cfg"]["type"] = "BN"
model = init_segmentor(config, checkpoint, device=device)
This is only for the configs/pspnet/pspnet_r50-d8_512x1024_40k_cityscapes.py
.
I hope this helps.
Replace all "SyncBN" in pspnet_r50-d8_512x1024_40k_cityscapes.py file with "BN" That's how I solved it you can try.
You may try to change the SyncBN to BN in your configfile
Thanks, it's resolved!
I tried to run this network on M1 Mac GPU, but still get this error..
import torch; torch.backends.mps.is_available()
True
Hi, could you create a device
with:
device = None
if torch.cuda.is_available():
device = "cuda"
elif torch.backends.mps.is_available():
device = "mps"
else:
device = "cpu"
print(f"device {device}")
then the model with:
model = init_segmentor(config, checkpoint, device=device)
and make sure that the model parameters are actually on your MPS device:
x = next(model.parameters())
print(x.device)
Thanks for the reply @ocanevet , the parameters are indeed on the MPS device:
lib/python3.6/site-packages/torch/nn/modules/batchnorm.py", line 433, in forward raise ValueError('SyncBatchNorm expected input tensor to be on GPU') ValueError: SyncBatchNorm expected input tensor to be on GPU
Getting this error when trying to run the inference script for single image on cpu, libraries used: torch-1.5.1-cpu mmcv_full-cpu