首先demo_det_r101.py已经可以正常跑通,然后我在使用export_det_r101_onnx.py时,报错
Traceback (most recent call last):
File "E:/LearningCodes/centernet/centernet-master/export_det_r101_onnx.py", line 191, in <module>
detector.export_onnx(data_f, 'centernet_r101_coco.onnx')
File "E:/LearningCodes/centernet/centernet-master/export_det_r101_onnx.py", line 179, in export_onnx
input_names=['image'],
File "D:\Anaconda3\envs\CenterNet\lib\site-packages\torch\onnx\__init__.py", line 25, in export
return utils.export(*args, **kwargs)
File "D:\Anaconda3\envs\CenterNet\lib\site-packages\torch\onnx\utils.py", line 131, in export
strip_doc_string=strip_doc_string)
File "D:\Anaconda3\envs\CenterNet\lib\site-packages\torch\onnx\utils.py", line 363, in _export
_retain_param_name, do_constant_folding)
File "D:\Anaconda3\envs\CenterNet\lib\site-packages\torch\onnx\utils.py", line 266, in _model_to_graph
graph, torch_out = _trace_and_get_graph_from_model(model, args, training)
File "D:\Anaconda3\envs\CenterNet\lib\site-packages\torch\onnx\utils.py", line 225, in _trace_and_get_graph_from_model
trace, torch_out = torch.jit.get_trace_graph(model, args, _force_outplace=True)
File "D:\Anaconda3\envs\CenterNet\lib\site-packages\torch\jit\__init__.py", line 231, in get_trace_graph
return LegacyTracedModule(f, _force_outplace, return_inputs)(*args, **kwargs)
File "D:\Anaconda3\envs\CenterNet\lib\site-packages\torch\nn\modules\module.py", line 493, in __call__
result = self.forward(*input, **kwargs)
File "D:\Anaconda3\envs\CenterNet\lib\site-packages\torch\jit\__init__.py", line 295, in forward
out_vars, _ = _flatten(out)
RuntimeError: Only tuples, lists and Variables supported as JIT inputs, but got dict