torch_mlu只有yolov3_detection_output和yolov5_detection_output,没有yolov4_detection_output,你可以用yolov3_detection_output替代。展开
使用pytorch教程量化yolov4-tiny模型后,在线运行步骤报错了,报错信息如下:CNML: 7.10.2 ba2048758CNRT: 4.10.1 a884a9awill run yolov4 int8 model ...start.....calc_cocoannFile: /data/datasets//COCO/annotations/instances_val2017.jsonloading annotations into memory...Done (t=0.32s)creating index...index created!5000Use yolov4-tiny . cfgfile is /home/test/pytorch/yolov4-tiny/online/yolov4/tool/../model/yolov4-tiny.cfg !!! convalution havn't activate linearconvalution havn't activate linearH:416, W:416half input/home/test/pytorch/yolov4-tiny/online/yolov4/tool/darknet2pytorch.py:186: TracerWarning: Converting a tensor to a Python index might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! x = outputs[layers[0]][:, b // groups * group_id:b // groups * (group_id + 1)]Use MLU Yolov4_detection op !Traceback (most recent call last): File "eval.py", line 333, in展开calc_coco(args) File "eval.py", line 187, in calc_coco model = torch.jit.trace(model, trace_input.to(device), check_trace=False) File "/torch/venv3/pytorch/lib/python3.6/site-packages/torch/jit/__init__.py", line 858, in trace check_tolerance, _force_outplace, _module_class) File "/torch/venv3/pytorch/lib/python3.6/site-packages/torch/jit/__init__.py", line 997, in trace_module module._c._create_method_from_trace(method_name, func, example_inputs, var_lookup_fn, _force_outplace) File "/torch/venv3/pytorch/lib/python3.6/site-packages/torch/nn/modules/module.py", line 539, in __call__ result = self._slow_forward(*input, **kwargs) File "/torch/venv3/pytorch/lib/python3.6/site-packages/torch/nn/modules/module.py", line 525, in _slow_forward result = self.forward(*input, **kwargs) File "/home/test/pytorch/yolov4-tiny/online/yolov4/tool/darknet2pytorch.py", line 256, in forward detect_out = torch.ops.torch_mlu.yolov4_detection_output(tuple(out_boxes), File "/torch/venv3/pytorch/lib/python3.6/site-packages/torch/_ops.py", line 61, in __getattr__ op = torch._C._jit_get_operation(qualified_op_name)RuntimeError: No such operator torch_mlu::yolov4_detection_output环境是:docker pytorch v1.3
torch_mlu只有yolov3_detection_output和yolov5_detection_output,没有yolov4_detection_output,你可以用yolov3_detection_output替代。
darknet2caffe.py这个脚本对yolov4支持的不太好,你可以试试用pytorch去转darknet的模型,可参考如下链接的教程:https://gitee.com/cambriconknight/dev-env-ubuntu/tree/master/pytorch/yolov4展开
使用pytorch教程量化yolov4-tiny模型后,在线运行步骤报错了,报错信息如下:
CNML: 7.10.2 ba2048758
CNRT: 4.10.1 a884a9a
will run yolov4 int8 model ...
start.....calc_coco
annFile: /data/datasets//COCO/annotations/instances_val2017.json
loading annotations into memory...
Done (t=0.32s)
creating index...
index created!
5000
Use yolov4-tiny .
cfgfile is /home/test/pytorch/yolov4-tiny/online/yolov4/tool/../model/yolov4-tiny.cfg !!!
convalution havn't activate linear
convalution havn't activate linear
H:416, W:416
half input
/home/test/pytorch/yolov4-tiny/online/yolov4/tool/darknet2pytorch.py:186: TracerWarning: Converting a tensor to a Python index might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs!
x = outputs[layers[0]][:, b // groups * group_id:b // groups * (group_id + 1)]
Use MLU Yolov4_detection op !
Traceback (most recent call last):
File "eval.py", line 333, in <module>
calc_coco(args)
File "eval.py", line 187, in calc_coco
model = torch.jit.trace(model, trace_input.to(device), check_trace=False)
File "/torch/venv3/pytorch/lib/python3.6/site-packages/torch/jit/__init__.py", line 858, in trace
check_tolerance, _force_outplace, _module_class)
File "/torch/venv3/pytorch/lib/python3.6/site-packages/torch/jit/__init__.py", line 997, in trace_module
module._c._create_method_from_trace(method_name, func, example_inputs, var_lookup_fn, _force_outplace)
File "/torch/venv3/pytorch/lib/python3.6/site-packages/torch/nn/modules/module.py", line 539, in __call__
result = self._slow_forward(*input, **kwargs)
File "/torch/venv3/pytorch/lib/python3.6/site-packages/torch/nn/modules/module.py", line 525, in _slow_forward
result = self.forward(*input, **kwargs)
File "/home/test/pytorch/yolov4-tiny/online/yolov4/tool/darknet2pytorch.py", line 256, in forward
detect_out = torch.ops.torch_mlu.yolov4_detection_output(tuple(out_boxes),
File "/torch/venv3/pytorch/lib/python3.6/site-packages/torch/_ops.py", line 61, in __getattr__
op = torch._C._jit_get_operation(qualified_op_name)
RuntimeError: No such operator torch_mlu::yolov4_detection_output
环境是:
docker pytorch v1.3
请登录后评论