ultralytics 8.1.37 fix empty sys.argv bug (#9390)

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: Joshua Harrison <108553645+TurbineJoshua@users.noreply.github.com>
Co-authored-by: Joshua Harrison <joshua@fido.investments>
Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
Glenn Jocher 2024-03-29 03:20:39 +01:00 committed by GitHub
parent ed2250cf1c
commit 4a7ccba0af
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 31 additions and 15 deletions

View file

@ -54,8 +54,9 @@ TASK2METRIC = {
"obb": "metrics/mAP50-95(B)",
}
ARGV = sys.argv or ["", ""] # sometimes sys.argv = []
CLI_HELP_MSG = f"""
Arguments received: {str(['yolo'] + sys.argv[1:])}. Ultralytics 'yolo' commands use the following syntax:
Arguments received: {str(['yolo'] + ARGV[1:])}. Ultralytics 'yolo' commands use the following syntax:
yolo TASK MODE ARGS
@ -452,7 +453,7 @@ def entrypoint(debug=""):
It uses the package's default cfg and initializes it using the passed overrides.
Then it calls the CLI function with the composed cfg
"""
args = (debug.split(" ") if debug else sys.argv)[1:]
args = (debug.split(" ") if debug else ARGV)[1:]
if not args: # no arguments passed
LOGGER.info(CLI_HELP_MSG)
return