fix yolov5 and classifier load single label model fail bug, and optimize cdk path check script

This commit is contained in:
Neucrack
2024-05-07 15:21:56 +08:00
parent e54e2c22e4
commit 8533c253df
4 changed files with 28 additions and 6 deletions

View File

@@ -15,7 +15,7 @@ def get_sdk_path():
# 1. get SDK absolute path from MAIXCDK_PATH env
try:
if os.environ[sdk_env_name] and os.path.exists(os.environ[sdk_env_name]):
if os.environ[sdk_env_name]:
sdk_path = os.environ[sdk_env_name]
except Exception:
pass
@@ -26,9 +26,14 @@ def get_sdk_path():
sdk_path = path
# 3. check if MaixCDK path valid
if not sdk_path or not os.path.exists(sdk_path):
if not sdk_path:
print("")
print("Error: can not find MaixCDK, please set MAIXCDK_PATH env to MaixCDK directory")
print("Error: can not find MaixCDK, please set MAIXCDK_PATH env to MaixCDK directory by `export MAIXCDK_PATH=xxxxx`")
print("")
sys.exit(1)
if not os.path.exists(sdk_path):
print("")
print(f"Error: MaixCDK set to {sdk_path}, but not exists!")
print("")
sys.exit(1)
return os.path.abspath(sdk_path)

View File

@@ -1,4 +1,4 @@
__version__ = "1.2.1"
__version__ = "1.2.2"