Weights download progress line floods non-terminal logs

オープン 初心者向け
#5 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
83/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
cli

調査の方向性

進捗出力は src/subcellseg/weights.py の _report_progress によって書き込まれます。まずその関数と、urlretrieve および stderr の使い方を確認してください。stderr をファイルに記録しながら、issue にあるコマンドで再現します。完了の条件は、非端末ログにダウンロードブロックごとの行ではなく、たまに進捗更新が出力され、ダウンロードとチェックサムの処理も完了することです。

索引モデルが issue の本文から書いたものです。

説明

enhancement good first 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分
マージ済み PR(30日)
4

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。