Issue with relative paths in data.yaml file when trying to train yolo custom model
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- python
- Lĩnh vực
- computer-vision, machine-learning
Hướng nghiên cứu
Bắt đầu với các đường dẫn data.yaml và entry point train_custom_dataset_yolo, sau đó tái hiện quá trình huấn luyện bằng các đường dẫn tương đối được hiển thị và so sánh đường dẫn đã được phân giải với trường hợp sử dụng đường dẫn tuyệt đối. Truy tìm lý do đường dẫn dataset bị lặp lại và xác minh rằng quá trình huấn luyện có thể tìm thấy các thư mục train và val bằng các đường dẫn tương đối trên một máy khác.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 629
- Fork
- 140
- Merge trung bình
- 2 ngày 2 giờ
- Pull request đã merge (30 ngày)
- 5
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của roboflow/roboflow-python
-
RLE segmentation mask visible in dataset thumbnail, but invisible in annotation preview/editor Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
roboflow/roboflow-python#505 · 1 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
roboflow/roboflow-python#433 ·
-
Dataset Download Stuck Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
roboflow/roboflow-python#429 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
roboflow/roboflow-python#427 · 1 bình luận ·
-
Inability to upload raw bytes Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
roboflow/roboflow-python#426 ·
Tất cả issue của roboflow/roboflow-python
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
stephrobert/dsoxlab#238 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
sublimehq/package_control#1780 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
nwg-piotr/nwg-displays#145 ·