DBNet.pytorch
DBNet.pytorch copied to clipboard
eval时遇到错误,如何解决??
Traceback (most recent call last):
File "tools/eval.py", line 78, in
求解决!谢谢大佬们!!
我是改了一下tools/eval.py def init_args(): parser = argparse.ArgumentParser(description='DBNet.pytorch') parser.add_argument('--model_path', required=False, default='output/DBNet_resnet18_FPN_DBHead/checkpoint/1.pth', type=str) parser.add_argument('--local_rank', dest='local_rank', default=0, type=int, help='Use distributed training')
args = parser.parse_args()
return args
if name == 'main': args = init_args() torch.distributed.init_process_group(backend="nccl", init_method="env://", world_size=torch.cuda.device_count(), rank=args.local_rank) eval = EVAL(args.model_path) result = eval.eval() print(result)
https://github.com/WenmuZhou/DBNet.pytorch/blob/678b2ae55e018c6c16d5ac182558517a154a91ed/tools/eval.py#L35
- 将上行代码,改为下面即可,因为这个不需要用分布式,所以设为False
self.validate_loader = get_dataloader(config['dataset']['validate'], False)