Skip to content

Commit

Permalink
🐛 convert.py support py37 py38 py39 on linux, py37 on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
ESP-YHY committed Sep 14, 2021
1 parent dcaaa93 commit bad67b5
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions tools/convert_tool/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
import platform

system_type = platform.system()
path = f'{os.path.dirname(__file__)}/{system_type.lower()}'
if system_type == 'Windows':
path = path.replace('/', '\\')
sys.path.append(path)
from utils import Convert
python_version = platform.python_version()
m, s, _ = python_version.split('.')
path = f'{os.path.dirname(os.path.abspath(__file__))}/{system_type.lower()}/{m}{s}'

if os.path.exists(path):
sys.path.append(path)
from utils import Convert

if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Model generator tool')
parser.add_argument('-t', '--target_chip', help='esp32, esp32s2, esp32s3, esp32c3')
parser.add_argument('-i', '--input_root', help="npy files root")
Expand All @@ -33,3 +34,5 @@
convert()
print(' Finish\n')

else:
print(f'Not supported python == {python_version} on {system_type}')
File renamed without changes.

0 comments on commit bad67b5

Please sign in to comment.