You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can get one stage algorithm but get two stage algorithm failed
failed~
(mmyd) ➜ mmdetection git:(3.x) python tools/analysis_tools/get_flops.py configs/faster_rcnn/faster-rcnn_r101_fpn_1x_coco.py
Traceback (most recent call last):
File "tools/analysis_tools/get_flops.py", line 88, in<module>main()
File "tools/analysis_tools/get_flops.py", line 73, in main
flops, params = get_model_complexity_info(model, input_shape)
File "/project/mmlab2/mmcv/mmcv/cnn/utils/flops_counter.py", line 106, in get_model_complexity_info
_ = flops_model(batch)
File "/home/elaine/miniconda3/envs/mmyd/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1120, in _call_impl
result = forward_call(*input, **kwargs)
File "/project/mmlab2/mmdetection/mmdet/models/detectors/base.py", line 96, in forward
return self._forward(inputs, data_samples)
File "/project/mmlab2/mmdetection/mmdet/models/detectors/two_stage.py", line 131, in _forward
rpn_results_list = self.rpn_head.predict(
File "/project/mmlab2/mmdetection/mmdet/models/dense_heads/base_dense_head.py", line 190, in predict
batch_img_metas = [
TypeError: 'NoneType' object is not iterable
What is the feature you are proposing to solve the problem?
None
What alternatives have you considered?
when I use fvcore to calculate flops is the same error, because of the data_samples is None
# Copyright (c) OpenMMLab. All rights reserved.importargparseimporttorchfromfvcore.nnimportFlopCountAnalysis, flop_count_tablefrommmengineimportConfigfrommmdet.registryimportMODELSfrommmdet.utilsimportregister_all_modulesfrommmengine.runnerimportRunnerregister_all_modules()
defparse_args():
parser=argparse.ArgumentParser(description='Train a detector')
parser.add_argument('config', help='train config file path')
parser.add_argument(
'--shape',
type=int,
nargs='+',
default=[640, 640],
help='input image size')
args=parser.parse_args()
returnargsdefmain():
args=parse_args()
iflen(args.shape) ==1:
h=w=args.shape[0]
eliflen(args.shape) ==2:
h, w=args.shapeelse:
raiseValueError('invalid input shape, please use --shape h w')
input_shape= (1, 3, h, w)
cfg=Config.fromfile(args.config)
# dataloader = Runner.build_dataloader(cfg.val_dataloader)model=MODELS.build(cfg.model)
# for idx, data_batch in enumerate(dataloader):# print(idx, data_batch)# break# flops = FlopCountAnalysis(model, (torch.ones(input_shape), data_batch['data_samples']))# flops = FlopCountAnalysis(model,{"inputs": data_batch['inputs'],"data_samples": data_batch['data_samples']})# flops = FlopCountAnalysis(model,data_batch['inputs'][0])flops=FlopCountAnalysis(model,torch.ones(input_shape))
# params = parameter_count_table(model)flops_data=flop_count_table(flops)
print(flops_data)
print('!!!Please be cautious if you use the results in papers. ''You may need to check if all ops are supported and verify that the ''flops computation is correct.')
if__name__=='__main__':
main()
The text was updated successfully, but these errors were encountered:
What is the problem this feature will solve?
I can get one stage algorithm but get two stage algorithm failed
failed~
yolov3 success
What is the feature you are proposing to solve the problem?
None
What alternatives have you considered?
when I use fvcore to calculate flops is the same error, because of the
data_samples
is NoneThe text was updated successfully, but these errors were encountered: