YOLOv8_Efficient
YOLOv8_Efficient copied to clipboard
你好,为什么我推理时报错TypeError: expected str, bytes or os.PathLike object, not list
Traceback (most recent call last):
File "detect.py", line 162, in
我想可能是你的运行路径或者环境路径配置有误,建议朝这个方向去检查下。如果问题仍然存在,我也会在其他机器上做个测试和复现,看怎么去解决。
I'm getting the same error.
# Load or create new YOLO model
if isinstance(model, str):
if model.endswith(".pt"):
self._load(model)
else:
self._new(model)
elif isinstance(model, Path):
self._load(str(model))
This code fixed the error.
# Load or create new YOLO model if isinstance(model, str): if model.endswith(".pt"): self._load(model) else: self._new(model) elif isinstance(model, Path): self._load(str(model))This code fixed the error.
Could you tell me where to add this code?
Sorry, I am fixing this type of problems and merging new features