uTensor / uTensor

TinyML AI inference library
Apache License 2.0
1.72k stars 227 forks source link

compiletestdata.py error in linux #3

Closed Knight-X closed 7 years ago

Knight-X commented 7 years ago
  1. Traceback (most recent call last): File "compileTestData.py", line 28, in FULL_OUTPUT_DIR = (Path.cwd() / OUTPUT_DIR).resolve() File "/usr/lib/python3.5/pathlib.py", line 1109, in resolve s = self._flavour.resolve(self) File "/usr/lib/python3.5/pathlib.py", line 330, in resolve return _resolve(base, str(path)) or sep File "/usr/lib/python3.5/pathlib.py", line 315, in _resolve target = accessor.readlink(newpath) File "/usr/lib/python3.5/pathlib.py", line 422, in readlink return os.readlink(path) FileNotFoundError: [Errno 2] No such file or directory: '/root/uTensor/TESTS/scripts/testData'

  2. Traceback (most recent call last): File "compileTestData.py", line 47, in exec(open(str(item), "r").read()) File "", line 17, in File "compileTestData.py", line 26, in mkdir os.makedirs(outPath) File "/usr/lib/python3.5/os.py", line 226, in makedirs head, tail = path.split(name) File "/usr/lib/python3.5/posixpath.py", line 103, in split i = p.rfind(sep) + 1 AttributeError: 'PosixPath' object has no attribute 'rfind'

Knight-X commented 7 years ago

https://docs.python.org/3/library/pathlib.html Path.resolve(strict=False) Make the path absolute, resolving any symlinks. A new path object is returned: If the path doesn’t exist and strict is True, FileNotFoundError is raised.

  1. before call path.resolve(), the folder should be existed in linux environment. Otherwise, it would output error message.

  2. the parameter in os module should be str

neil-tan commented 7 years ago

Thanks for the PR, merged.