PaddleNLP
PaddleNLP copied to clipboard
[Bug]: UIE使用label_stuido.py制作数据时,对windows操作系统的兼容问题
软件环境
- 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))
感谢反馈,欢迎开发者进行贡献