遇到读取图片失败的问题:
[ WARN:0@0.047] global loadsave.cpp:244 findDecoder imread_(‘./train/brain_coral/n01917289_765.JPEG’): can’t open/read file: check file path/integrity
2023-05-05 13:41:24,624 - 139905329514048 - image_decode_cv2.py-image_decode_cv2:68 - ERROR: Read image ./train/brain_coral/n01917289_765.JPEG failed
Traceback (most recent call last):
File “/home/ygd/source2023/milvus-example/reverse_image_search/my.py”, line 95, in
p_insert(INSERT_SRC)
File “/home/ygd/.local/lib/python3.10/site-packages/towhee/runtime/runtime_pipeline.py”, line 121, in call
outputs = graph(inputs)
File “/home/ygd/.local/lib/python3.10/site-packages/towhee/runtime/runtime_pipeline.py”, line 85, in call
return self.result()
File “/home/ygd/.local/lib/python3.10/site-packages/towhee/runtime/runtime_pipeline.py”, line 72, in result
raise RuntimeError(errs)
RuntimeError: Node-_OperatorLazyWrapper-1 runs failed, error msg: Read image ./train/brain_coral/n01917289_765.JPEG failed, Traceback (most recent call last):
File “/home/ygd/.local/lib/python3.10/site-packages/towhee/runtime/nodes/node.py”, line 156, in _call
return True, self._op(*inputs), None
File “/home/ygd/.local/lib/python3.10/site-packages/towhee/engine/execution/base_execution.py”, line 50, in call
res = self._op(*arg, **kws)
File “/home/ygd/.local/lib/python3.10/site-packages/towhee/engine/operator_registry.py”, line 201, in wrapper_call
return old_call(self, *args, **kws)
File “/home/ygd/.towhee/operators/towhee/image_decode/main/image_decode.py”, line 14, in call
return self._op(image_path)
File “/home/ygd/.local/lib/python3.10/site-packages/towhee/engine/execution/base_execution.py”, line 50, in call
res = self._op(*arg, **kws)
File “/home/ygd/.towhee/operators/image-decode/cv2/main/image_decode_cv2.py”, line 69, in call
raise RuntimeError(err)
RuntimeError: Read image ./train/brain_coral/n01917289_765.JPEG failed
查找了一下资料,原来使用cv2读取图片时使用了相对路径的问题。修改了reverse_image_search.csv中图片的相对路径为绝对路径,解决问题。
ERROR: Read image ./train/brain_coral/n01917289_765.JPEG failed问题
最新推荐文章于 2024-08-16 14:15:02 发布