RK3588 代码中导入torch报错
使用RK3588测试官方的YOLOv8,出现下面的问题
发现是dfl函数中导入torch的时候产生的,但是我在python终端上执行导入torch并没有发生报错
Traceback (most recent call last):File "infer.py", line 243, in <module>boxes, classes, scores = post_process(outputs)File "infer.py", line 122, in post_processboxes.append(box_process(input_data[pair_per_branch*i]))File "infer.py", line 108, in box_processposition = dfl(position)File "infer.py", line 88, in dflimport torchFile "/home/pi/archiconda3/envs/py38/lib/python3.8/site-packages/torch/__init__.py", line 1896, in <module>from torch import export as exportFile "/home/pi/archiconda3/envs/py38/lib/python3.8/site-packages/torch/export/__init__.py", line 28, in <module>from torch.fx.passes.infra.pass_base import PassResultFile "/home/pi/archiconda3/envs/py38/lib/python3.8/site-packages/torch/fx/passes/__init__.py", line 3, in <module>from . import net_min_baseFile "/home/pi/archiconda3/envs/py38/lib/python3.8/site-packages/torch/fx/passes/net_min_base.py", line 12, in <module>from .split_utils import split_by_tagsFile "/home/pi/archiconda3/envs/py38/lib/python3.8/site-packages/torch/fx/passes/split_utils.py", line 8, in <module>from torch.fx.passes.utils import HolderModule, lift_subgraph_as_moduleFile "/home/pi/archiconda3/envs/py38/lib/python3.8/site-packages/torch/fx/passes/utils/__init__.py", line 1, in <module>from .common import lift_subgraph_as_module, HolderModule, compare_graphsFile "/home/pi/archiconda3/envs/py38/lib/python3.8/site-packages/torch/fx/passes/utils/common.py", line 7, in <module>from torch.fx.passes.utils.matcher_utils import SubgraphMatcherFile "/home/pi/archiconda3/envs/py38/lib/python3.8/site-packages/torch/fx/passes/utils/matcher_utils.py", line 31, in <module>logger = _init_logger()File "/home/pi/archiconda3/envs/py38/lib/python3.8/site-packages/torch/fx/passes/utils/matcher_utils.py", line 21, in _init_loggerlogger.setLevel(level)File "/home/pi/archiconda3/envs/py38/lib/python3.8/logging/__init__.py", line 1421, in setLevelself.level = _checkLevel(level)File "/home/pi/archiconda3/envs/py38/lib/python3.8/logging/__init__.py", line 198, in _checkLevelraise ValueError("Unknown level: %r" % level)
ValueError: Unknown level: 'WARNING'
我尝试着将torch版本更换为2.2 2.1均失败,均出现上面的错误,直到我更新为1.13后再进行YOLOv8的推理才成功