Skip to content

fix(visualizer): expand user path in visualizer.py (#9467) - #9490

Open
R1212122 wants to merge 1 commit into
PaddlePaddle:developfrom
R1212122:fix-visualizer-path-9467
Open

fix(visualizer): expand user path in visualizer.py (#9467)#9490
R1212122 wants to merge 1 commit into
PaddlePaddle:developfrom
R1212122:fix-visualizer-path-9467

Conversation

@R1212122

@R1212122 R1212122 commented Jun 11, 2026

Copy link
Copy Markdown

问题

修复 #9467ppdet/utils/visualizer.py 第 112 行使用了未扩展的路径(如 ~),运行推理时会在当前目录生成 ~ 文件夹,影响用户使用。

根因

download.pyWEIGHTS_HOME = osp.expanduser("~/.cache/paddle/weights") 已正确展开,
visualizer.py 第 112 行传了未展开的 "~/.cache/paddle/"get_path()

修复

使用 os.path.expanduser() 包裹路径变量,确保用户主目录路径被正确展开。

-    font_path, _ = get_path(font_url, "~/.cache/paddle/")
+    font_path, _ = get_path(font_url, os.path.expanduser("~/.cache/paddle/"))

测试

  • python -m py_compile ppdet/utils/visualizer.py 通过
  • 语法检查通过
  • 本地推理可视化测试(待 manual 验证)

影响

  • 风险:极低(仅修改 1 行)
  • 兼容性:完全向后兼容
  • 性能:无影响

Checklist

  • 签 CLA(CLAassistant bot 自动检测)
  • 修复一个 issue
  • 单行修改,PR 标题用英文 + issue 编号

@R1212122

Copy link
Copy Markdown
Author

ping @CLAassistant

@R1212122

Copy link
Copy Markdown
Author

I have read and agree to the PaddlePaddle Contributor License Agreement.

@CLAassistant

CLAassistant commented Jun 11, 2026

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@R1212122

Copy link
Copy Markdown
Author

CLA signed, please recheck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants