PaddleNLP icon indicating copy to clipboard operation
PaddleNLP copied to clipboard

[Bug]: UIE使用label_stuido.py制作数据时,对windows操作系统的兼容问题

Open MrZhousf opened this issue 1 year ago • 1 comments

软件环境

- paddlepaddle:
- paddlepaddle-gpu: 
- paddlenlp:

重复问题

  • [X] I have searched the existing issues

错误描述

img_path = os.path.join("/".join(self.label_studio_file.split("/")[:-1]), "images", img_file)
该代码无法兼容windows操作系统的文件路径,建议使用pathlib进行替换,如下:
img_path = str(Path(self.label_studio_file).parent.joinpath("images").joinpath(img_file))

稳定复现步骤 & 代码

使用windows操作系统执行label_studio.py制作数据会报错 Image file not exist in ./data/images 将tools.py的369行代码 img_path = os.path.join("/".join(self.label_studio_file.split("/")[:-1]), "images", img_file) 替换成下面: img_path = str(Path(self.label_studio_file).parent.joinpath("images").joinpath(img_file))

MrZhousf avatar Jul 10 '23 06:07 MrZhousf

感谢反馈,欢迎开发者进行贡献

w5688414 avatar May 07 '24 10:05 w5688414