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

Fix TypeError: 'PosixPath' object is not iterable #3285

Merged
merged 1 commit into from
May 21, 2021

Conversation

glenn-jocher
Copy link
Member

@glenn-jocher glenn-jocher commented May 21, 2021

Fix for error produced when evolving:

Traceback (most recent call last):
  File "train.py", line 617, in <module>
    results = train(hyp.copy(), opt, device)
  File "train.py", line 422, in train
    for m in (last, best) if best.exists() else (last):  # speed, mAP tests
TypeError: 'PosixPath' object is not iterable

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

Improved consistency in test model selection logic in training script.

📊 Key Changes

  • Adjusted the tuple to a list when determining which models (last, best) to test after training.

🎯 Purpose & Impact

  • The change ensures consistent behavior in the selection of models for testing, leading to more reliable post-training evaluations.
  • Users can expect consistent testing of both the last and best models when they exist, without any unintended logic errors.

@glenn-jocher glenn-jocher merged commit dd7f0b7 into master May 21, 2021
@glenn-jocher glenn-jocher deleted the glenn-jocher-patch-1 branch May 21, 2021 21:35
@glenn-jocher glenn-jocher self-assigned this May 21, 2021
Lechtr pushed a commit to Lechtr/yolov5 that referenced this pull request Jul 20, 2021
BjarneKuehl pushed a commit to fhkiel-mlaip/yolov5 that referenced this pull request Aug 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant