Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with --evolve #9329

Closed
2 tasks done
robinned opened this issue Sep 8, 2022 · 2 comments
Closed
2 tasks done

Issue with --evolve #9329

robinned opened this issue Sep 8, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@robinned
Copy link
Contributor

robinned commented Sep 8, 2022

Search before asking

  • I have searched the YOLOv5 issues and found no similar bug report.

YOLOv5 Component

Training

Bug

Hi! First bug report here, so hopefully I've added the right amount of info.

When trying to evolve hyperparameters, train.py throws the below IsADirectoryError. The program appears to work fine if the or opt.evolve on line 486 of train.py is deleted. That's the gist of the issue, below is just some extra info that I came across while trying to figure out why the error happened.

From what I can gather by looking at the code, it seems like when the --evolve flag is given to train.py, the program tries to resume from a previous run (it enters the same block of code as when --resume is given). Looking into the commit history, this commit seems to have changed the if statement on line 486 of train.py to run the if statement's code block when --evolve is passed, while before the commit, passing --evolve made it skip that code block.

(This is the full output from running the reproducible example code)

Cloning into 'yolov5'...
remote: Enumerating objects: 12209, done.
remote: Counting objects: 100% (12/12), done.
remote: Compressing objects: 100% (12/12), done.
remote: Total 12209 (delta 0), reused 4 (delta 0), pack-reused 12197
Receiving objects: 100% (12209/12209), 12.61 MiB | 22.74 MiB/s, done.
Resolving deltas: 100% (8404/8404), done.
/content/yolov5
     |████████████████████████████████| 1.6 MB 4.1 MB/s 
train: weights=yolov5s.pt, cfg=, data=coco128.yaml, hyp=data/hyps/hyp.scratch-low.yaml, epochs=10, batch_size=16, imgsz=640, rect=False, resume=False, nosave=False, noval=False, noautoanchor=False, noplots=False, evolve=300, bucket=, cache=ram, image_weights=False, device=, multi_scale=False, single_cls=False, optimizer=SGD, sync_bn=False, workers=8, project=runs/train, name=exp, exist_ok=False, quad=False, cos_lr=False, label_smoothing=0.0, patience=100, freeze=[0], save_period=-1, seed=0, local_rank=-1, entity=None, upload_dataset=False, bbox_interval=-1, artifact_alias=latest
github: up to date with https://github.com/ultralytics/yolov5 ✅
Traceback (most recent call last):
  File "train.py", line 630, in <module>
    main(opt)
  File "train.py", line 494, in main
    d = torch.load(last, map_location='cpu')['opt']
  File "/usr/local/lib/python3.7/dist-packages/torch/serialization.py", line 699, in load
    with _open_file_like(f, 'rb') as opened_file:
  File "/usr/local/lib/python3.7/dist-packages/torch/serialization.py", line 230, in _open_file_like
    return _open_file(name_or_buffer, mode)
  File "/usr/local/lib/python3.7/dist-packages/torch/serialization.py", line 211, in __init__
    super(_open_file, self).__init__(open(name, mode))
IsADirectoryError: [Errno 21] Is a directory: '.'

Environment

-Google Colab Pro
-High Ram and GPU acceleration
-wandb version 0.12.10 installed
-Yolov5s

Minimal Reproducible Example

Running this on a fresh Colab notebook with GPU acceleration will replicate the issue

!git clone https://github.com/ultralytics/yolov5  # clone
%cd yolov5
%pip install -qr requirements.txt  # install

import torch

!python train.py --epochs 10 --data coco128.yaml --weights yolov5s.pt --cache --evolve

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!
@robinned robinned added the bug Something isn't working label Sep 8, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Sep 8, 2022

👋 Hello @robinned, thank you for your interest in YOLOv5 🚀! Please visit our ⭐️ Tutorials to get started, where you can find quickstart guides for simple tasks like Custom Data Training all the way to advanced concepts like Hyperparameter Evolution.

If this is a 🐛 Bug Report, please provide screenshots and minimum viable code to reproduce your issue, otherwise we can not help you.

If this is a custom training ❓ Question, please provide as much information as possible, including dataset images, training logs, screenshots, and a public link to online W&B logging if available.

For business inquiries or professional support requests please visit https://ultralytics.com or email support@ultralytics.com.

Requirements

Python>=3.7.0 with all requirements.txt installed including PyTorch>=1.7. To get started:

git clone https://github.com/ultralytics/yolov5  # clone
cd yolov5
pip install -r requirements.txt  # install

Environments

YOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):

Status

CI CPU testing

If this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are currently passing. CI tests verify correct operation of YOLOv5 training (train.py), validation (val.py), inference (detect.py) and export (export.py) on macOS, Windows, and Ubuntu every 24 hours and on every commit.

@glenn-jocher
Copy link
Member

@robinned hi there! Thanks for reporting this issue with clear and detailed information. We appreciate your effort! Our team will look into this and address it promptly. Your understanding and patience are highly valued. In the meantime, your willingness to submit a PR is greatly appreciated. If you have any further questions or need assistance, feel free to ask. Thank you for your support!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants