Weights download progress line floods non-terminal logs
还没有人认领这个 Issue。
评估
调研方向
进度输出由 src/subcellseg/weights.py 中的 _report_progress 写入;先阅读该函数以及它如何使用 urlretrieve 和 stderr。使用 issue 中的命令复现,并将 stderr 捕获到文件中。完成的标准是,非终端日志中只有偶尔出现的进度更新,而不是每个下载块都占一行,同时下载和校验和仍能完成。
由索引模型根据 Issue 内容生成。
描述
What happens
On first use, subcellseg predict downloads the pretrained weights (64 MB) and prints a progress line from _report_progress in src/subcellseg/weights.py. The line is rewritten with \r on every urlretrieve block (8 KB), which is about 8,000 writes for one download.
In a terminal this looks fine. When stderr is not a terminal (CI logs, nohup, SLURM output files, notebook cells), every redraw is kept. A single download on 2026-11-11 produced about 150 KB of repeated 0 / 64 MB (0%) text.
Nothing is functionally wrong: the download completes, the SHA-256 check passes, and the segmentation is unaffected.
Suggested fix
- Write a new line only when the whole-number percentage changes (at most 100 updates), and
- when
sys.stderr.isatty()is false, print only a start line and a done line (or one line every 10%).
How to reproduce
SUBCELLSEG_CACHE_DIR=$(mktemp -d) subcellseg predict --input in --output out 2> log.txt
wc -c log.txt
- 主要语言
- Python
- 星标
- 0
- 派生
- 0
- 平均合并
- 4 小时 27 分钟
- 30 天内合并 PR
- 4
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
相似的 Issue
-
physical
难度 2/5 1-3 小时 新手友好度 74/100
antonyrag/ragleap-core#1339 ·
-
[🐛 Bug]: oidc_authverifier.py strips trailing slash causing "Invalid token: Invalid issuer" error未关闭
难度 2/5 1-3 小时 新手友好度 76/100
keephq/keep#6934 · 1 个 reaction ·
维护者通常 1 天内回复
-
bug game: 01008BA02525A000 ios
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
needs-triage
难度 1/5 1 小时以内 新手友好度 87/100
gke-labs/kube-agents#5501 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 76/100
open-webui/open-webui#34128 ·
维护者通常 1 天内回复