Closed Eileen2014 closed 5 years ago
Is your gpu available? check https://github.com/ooooverflow/BiSeNet/blob/master/eval.py#L70, after
model = torch.nn.DataParallel(model).cuda()
model
need to load state dict by:
model.module.load_state_dict(torch.load(args.checkpoint_path))
Not:
model.load_state_dict(torch.load(args.checkpoint_path))
Maybe a better solution is load state dict before line:
model = torch.nn.DataParallel(model).cuda()
Have anyone solved this problem???
Have anyone solved this problem???
have you sovled it?
have you sovled it?
maybe you just delete .module if you just you use one gpu.
no I didn't . Thanks I'll try @zz10001
if your pc have more than one gpu. Before: model.to(device) You should add: model = nn.DataParallel(model)
BEFORE: device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") model.to(device) AFTER: device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") if torch.cuda.device_count() > 1: \Space model = nn.DataParallel(model) model.to(device)
load model from ./checkpoints/epoch_295.pth ... Traceback (most recent call last): File "c:\Users\Administrator\Desktop\BiSeNet-master\BiSeNet-master\demo.py", line 80, in
main(params)
File "c:\Users\Administrator\Desktop\BiSeNet-master\BiSeNet-master\demo.py", line 60, in main
model.module.load_state_dict(torch.load(args.checkpoint_path))
File "C:\Program Files\Python\lib\site-packages\torch\nn\modules\module.py", line 518, in getattr
type(self).name, name))
AttributeError: 'BiSeNet' object has no attribute 'module'
PS C:\Users\Administrator\Desktop\BiSeNet-master\BiSeNet-master>
Where do I put the dataset ?