Issue with relative paths in data.yaml file when trying to train yolo custom model
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- python
調査の方向性
data.yaml のパスと train_custom_dataset_yolo エントリーポイントから始め、次に、示されている相対パスでトレーニングを再現し、解決されたパスを絶対パスの場合と比較します。データセットのパスが繰り返される理由を追跡し、別のマシンで相対パスを使ってトレーニングが train および val ディレクトリを見つけられることを確認します。
索引モデルが issue の本文から書いたものです。
説明
I am trying to create a training pipeline to train a custom yolov9 model with user inputted labeled images.
I am having an issue where if I make my data.yaml file use relative paths, I get the error:
RuntimeError: Dataset 'OIT_model/customOIT/customdatasetyolo/data.yaml' error
Dataset 'OIT_model/customOIT/customdatasetyolo/data.yaml' images not found , missing path 'C:\GitHub\Anomaly_detection_combine\OIT_model\Anomaly_detection_combine\OIT_model\customOIT\customdatasetyolo\Anomaly_detection_combine\OIT_model\customOIT\customdatasetyolo\val'
What is even more odd, is that the path the error mentions,
'C:\\GitHub\\Anomaly_detection_combine\\OIT_model\\Anomaly_detection_combine\\OIT_model\\customOIT\\customdatasetyolo\\Anomaly_detection_combine\\OIT_model\\customOIT\\customdatasetyolo\\val'
is not a path that exists or is being requested anywhere. The actual path is
'C:\\GitHub\\Anomaly_detection_combine\\OIT_model\\customOIT\\customdatasetyolo\\val'
for some reason it is repeating the first part of the path 3 times.
This is the data.yaml file:
path: OIT_model/customOIT/customdatasetyolo
train: OIT_model/customOIT/customdatasetyolo/train
val: OIT_model/customOIT/customdatasetyolo/val
nc: 1
names: ['5']
and this is the code that is starting training:
def train_custom_dataset_yolo(data_path, epochs=100, imgsz=64, verbose=True):
model = YOLO("OIT_model/yolov9c.pt")
# Specify the save directory for training runs
save_dir = 'OIT_model/customOIT/yolocustomtrainoutput'
if os.path.exists(save_dir):
for file in os.listdir(save_dir):
file_path = os.path.join(save_dir, file)
if os.path.isfile(file_path) or os.path.islink(file_path):
os.unlink(file_path)
elif os.path.isdir(file_path):
shutil.rmtree(file_path)
os.makedirs(save_dir, exist_ok=True)
model.train(data=data_path, epochs=epochs, imgsz=imgsz, verbose=verbose, save_dir=save_dir)
return
train_custom_dataset_yolo('OIT_model/customOIT/customdatasetyolo/data.yaml', epochs=1,imgsz=64, verbose=True)
Very strangely however, when I replace the relative paths with absolute paths, like so:
path: C:/GitHub/fix/Anomaly_detection_combine/OIT_model/customOIT/customdatasetyolo
train: C:/GitHub/fix/Anomaly_detection_combine/OIT_model/customOIT/customdatasetyolo/train
val: C:/GitHub/fix/Anomaly_detection_combine/OIT_model/customOIT/customdatasetyolo/val
nc: 1
names: ['5']
training works without issue. Using absolute pathing is not an option for me, as this application needs to be reproductible on others machines.
- 主要言語
- Python
- スター
- 629
- フォーク
- 140
- 平均マージ
- 2日 2時間
- マージ済み PR(30日)
- 5
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
roboflow/roboflow-python のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
roboflow/roboflow-python#505 · コメント 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
roboflow/roboflow-python#433 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
roboflow/roboflow-python#429 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
roboflow/roboflow-python#427 · コメント 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
roboflow/roboflow-python#426 ·
roboflow/roboflow-python の issue をすべて見る
似ている issue
-
area: harness bug status: needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
Human-Agent-Society/reef#625 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 80/100
learningequality/kolibri#15351 · コメント 2 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
Name consistency オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
eellak/triplestore#65 · コメント 1 件 ·