-
Notifications
You must be signed in to change notification settings - Fork 5
Description
I can't get this example to work. I'm not sure if this is because of inconsistencies with newer dependencies but everything I tried was unsuccessful. This is what I tried so far:
The first error I get when following the example step by step is
Traceback (most recent call last):
File "/Users/cglaser/work/ARIANNA/analysis/2019deeplearning/classification/uTensor_examples/simple_cnn_tutorial/.venv/bin/utensor-cli", line 5, in <module>
from utensor_cgen.cli import cli
File "/Users/cglaser/work/ARIANNA/analysis/2019deeplearning/classification/uTensor_examples/simple_cnn_tutorial/.venv/lib/python2.7/site-packages/utensor_cgen/cli.py", line 8, in <module>
from .utils import NArgsParam
File "/Users/cglaser/work/ARIANNA/analysis/2019deeplearning/classification/uTensor_examples/simple_cnn_tutorial/.venv/lib/python2.7/site-packages/utensor_cgen/utils.py", line 11, in <module>
from tensorflow.tools.graph_transforms import TransformGraph
ImportError: No module named graph_transforms
which is because tensorflow 2.1.0 was installed by pip install utensor_cgen==0.3.3.dev2
So I downgraded tensorflow to 1.13.2 but then I just run into the next error:
utensor-cli convert cifar10_cnn.pb --output-nodes=fully_connect_2/logits
WARNING: The TensorFlow contrib module will not be included in TensorFlow 2.0.
For more information, please see:
* https://github.com/tensorflow/community/blob/master/rfcs/20180907-contrib-sunset.md
* https://github.com/tensorflow/addons
If you depend on functionality not listed there, please file an issue.
Traceback (most recent call last):
File "/Users/cglaser/work/ARIANNA/analysis/2019deeplearning/classification/uTensor_examples/simple_cnn_tutorial/.venv/bin/utensor-cli", line 8, in <module>
sys.exit(cli())
File "/Users/cglaser/work/ARIANNA/analysis/2019deeplearning/classification/uTensor_examples/simple_cnn_tutorial/.venv/lib/python2.7/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/Users/cglaser/work/ARIANNA/analysis/2019deeplearning/classification/uTensor_examples/simple_cnn_tutorial/.venv/lib/python2.7/site-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/Users/cglaser/work/ARIANNA/analysis/2019deeplearning/classification/uTensor_examples/simple_cnn_tutorial/.venv/lib/python2.7/site-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/cglaser/work/ARIANNA/analysis/2019deeplearning/classification/uTensor_examples/simple_cnn_tutorial/.venv/lib/python2.7/site-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/cglaser/work/ARIANNA/analysis/2019deeplearning/classification/uTensor_examples/simple_cnn_tutorial/.venv/lib/python2.7/site-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/Users/cglaser/work/ARIANNA/analysis/2019deeplearning/classification/uTensor_examples/simple_cnn_tutorial/.venv/lib/python2.7/site-packages/utensor_cgen/cli.py", line 84, in convert_graph
generator.generate(model_path)
File "/Users/cglaser/work/ARIANNA/analysis/2019deeplearning/classification/uTensor_examples/simple_cnn_tutorial/.venv/lib/python2.7/site-packages/utensor_cgen/backend/code_generator.py", line 49, in generate
parser_cls = FrontendSelector.select_parser(ext)
File "/Users/cglaser/work/ARIANNA/analysis/2019deeplearning/classification/uTensor_examples/simple_cnn_tutorial/.venv/lib/python2.7/site-packages/utensor_cgen/frontend/__init__.py", line 26, in select_parser
cls._setup()
File "/Users/cglaser/work/ARIANNA/analysis/2019deeplearning/classification/uTensor_examples/simple_cnn_tutorial/.venv/lib/python2.7/site-packages/utensor_cgen/frontend/__init__.py", line 46, in _setup
importlib.import_module(mod_name)
File "/Users/cglaser/.pyenv/versions/2.7.15/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/Users/cglaser/work/ARIANNA/analysis/2019deeplearning/classification/uTensor_examples/simple_cnn_tutorial/.venv/lib/python2.7/site-packages/utensor_cgen/frontend/onnx.py", line 2, in <module>
from onnx_tf.backend import prepare
File "/Users/cglaser/work/ARIANNA/analysis/2019deeplearning/classification/uTensor_examples/simple_cnn_tutorial/.venv/lib/python2.7/site-packages/onnx_tf/__init__.py", line 1, in <module>
from . import backend
File "/Users/cglaser/work/ARIANNA/analysis/2019deeplearning/classification/uTensor_examples/simple_cnn_tutorial/.venv/lib/python2.7/site-packages/onnx_tf/backend.py", line 29, in <module>
from onnx_tf.common.handler_helper import get_all_backend_handlers
File "/Users/cglaser/work/ARIANNA/analysis/2019deeplearning/classification/uTensor_examples/simple_cnn_tutorial/.venv/lib/python2.7/site-packages/onnx_tf/common/handler_helper.py", line 5, in <module>
from onnx_tf.handlers.backend import * # noqa
File "/Users/cglaser/work/ARIANNA/analysis/2019deeplearning/classification/uTensor_examples/simple_cnn_tutorial/.venv/lib/python2.7/site-packages/onnx_tf/handlers/backend/scatter_nd.py", line 8, in <module>
@tf_func(tf.tensor_scatter_nd_update)
AttributeError: 'module' object has no attribute 'tensor_scatter_nd_update'
make: *** [models/cifar10_cnn.cpp] Error 1
I get the same error also for python 3.7.3.
I then tried upgrading utensor_cgen to the latest release, but this also crashes maybe because it is not python2.7 compatible anymore?
pip install utensor_cgen --upgrade
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting utensor_cgen
Using cached https://files.pythonhosted.org/packages/a2/a3/d6db368011e481e38dce7b209d3818942b5dc157ef8b528b8cf3bf414d64/utensor_cgen-0.4.2.tar.gz
ERROR: Command errored out with exit status 1:
command: /Users/cglaser/work/ARIANNA/analysis/2019deeplearning/classification/uTensor_examples/simple_cnn_tutorial/.venv/bin/python2.7 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/bt/vcs5g33x3mn05hx6tn023ssc0000gn/T/pip-install-OxAhcH/utensor-cgen/setup.py'"'"'; __file__='"'"'/private/var/folders/bt/vcs5g33x3mn05hx6tn023ssc0000gn/T/pip-install-OxAhcH/utensor-cgen/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/bt/vcs5g33x3mn05hx6tn023ssc0000gn/T/pip-install-OxAhcH/utensor-cgen/pip-egg-info
cwd: /private/var/folders/bt/vcs5g33x3mn05hx6tn023ssc0000gn/T/pip-install-OxAhcH/utensor-cgen/
Complete output (24 lines):
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/bt/vcs5g33x3mn05hx6tn023ssc0000gn/T/pip-install-OxAhcH/utensor-cgen/setup.py", line 79, in <module>
"Topic :: Utilities"
File "/Users/cglaser/work/ARIANNA/analysis/2019deeplearning/classification/uTensor_examples/simple_cnn_tutorial/.venv/lib/python2.7/site-packages/setuptools/__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "/Users/cglaser/.pyenv/versions/2.7.15/lib/python2.7/distutils/core.py", line 111, in setup
_setup_distribution = dist = klass(attrs)
File "/Users/cglaser/work/ARIANNA/analysis/2019deeplearning/classification/uTensor_examples/simple_cnn_tutorial/.venv/lib/python2.7/site-packages/setuptools/dist.py", line 448, in __init__
k: v for k, v in attrs.items()
File "/Users/cglaser/.pyenv/versions/2.7.15/lib/python2.7/distutils/dist.py", line 287, in __init__
self.finalize_options()
File "/Users/cglaser/work/ARIANNA/analysis/2019deeplearning/classification/uTensor_examples/simple_cnn_tutorial/.venv/lib/python2.7/site-packages/setuptools/dist.py", line 740, in finalize_options
ep.load()(self)
File "/Users/cglaser/work/ARIANNA/analysis/2019deeplearning/classification/uTensor_examples/simple_cnn_tutorial/.venv/lib/python2.7/site-packages/setuptools/dist.py", line 747, in _finalize_setup_keywords
ep.load()(self, ep.name, value)
File "/private/var/folders/bt/vcs5g33x3mn05hx6tn023ssc0000gn/T/pip-install-OxAhcH/utensor-cgen/.eggs/better_setuptools_git_version-1.0.5-py2.7.egg/better_setuptools_git_version.py", line 82, in validate_version_config
dist.metadata.version = get_version(template, starting_version)
File "/private/var/folders/bt/vcs5g33x3mn05hx6tn023ssc0000gn/T/pip-install-OxAhcH/utensor-cgen/.eggs/better_setuptools_git_version-1.0.5-py2.7.egg/better_setuptools_git_version.py", line 52, in get_version
tag = get_tag()
File "/private/var/folders/bt/vcs5g33x3mn05hx6tn023ssc0000gn/T/pip-install-OxAhcH/utensor-cgen/.eggs/better_setuptools_git_version-1.0.5-py2.7.egg/better_setuptools_git_version.py", line 9, in get_tag
return subprocess.getoutput("git tag --sort=version:refname --merged | tail -n1")
AttributeError: 'module' object has no attribute 'getoutput'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
With python3 I upgraded utensor_cgen to the latest version which also downgraded tensorflow to 1.13.1
Successfully installed graphviz-0.13.2 onnx-tf-1.2.1 tensorflow-1.13.1 toml-0.10.0 utensor-cgen-0.4.2
This allows to execute utensor-cli convert cifar10_cnn.pb --output-nodes fully_connect_2/logits
without errors.
However, the compilation of the mbed code then crashes with
mbed compile -m auto -t GCC_ARM --profile=uTensor/build_profile/release.json -f
[mbed] Working path "/Users/cglaser/work/ARIANNA/analysis/2019deeplearning/classification/uTensor_examples/simple_cnn_tutorial_p3" (program)
[mbed] WARNING: Could not find mbed program in current path "/Users/cglaser/work/ARIANNA/analysis/2019deeplearning/classification/uTensor_examples/simple_cnn_tutorial_p3".
You can fix this by calling "mbed new ." in the root of your program.
---
[mbed] Detected "K64F" connected to "/Volumes/DAPLINK" and using com port "/dev/tty.usbmodem1422"
[Warning] @,: Compiler version mismatch: Have 9.2.1; expected version >= 6.0.0 and < 7.0.0
Building project simple_cnn_tutorial_p3 (K64F, GCC_ARM)
Scan: simple_cnn_tutorial_p3
...
Compile [ 85.2%]: mbed_rtc_time.cpp
[Error] mbed_rtc_time.cpp@89,22: invalid use of incomplete type 'const struct timeval'
[Error] mbed_rtc_time.cpp@110,7: invalid use of incomplete type 'struct timeval'
[Error] mbed_rtc_time.cpp@111,7: invalid use of incomplete type 'struct timeval'
[Error] mbed_rtc_time.cpp@124,20: aggregate 'timeval tv' has incomplete type and cannot be defined
[Error] mbed_rtc_time.cpp@137,26: variable 'const timeval tv' has initializer but incomplete type
[ERROR] '_queue.SimpleQueue' object has no attribute 'queue'
[mbed] ERROR: "/Users/cglaser/work/ARIANNA/analysis/2019deeplearning/classification/uTensor_examples/simple_cnn_tutorial_p3/.venv/bin/python" returned error.
Code: 1
Path: "/Users/cglaser/work/ARIANNA/analysis/2019deeplearning/classification/uTensor_examples/simple_cnn_tutorial_p3"
Command: "/Users/cglaser/work/ARIANNA/analysis/2019deeplearning/classification/uTensor_examples/simple_cnn_tutorial_p3/.venv/bin/python -u /Users/cglaser/work/ARIANNA/analysis/2019deeplearning/classification/uTensor_examples/simple_cnn_tutorial_p3/mbed-os/tools/make.py -t GCC_ARM -m K64F --profile uTensor/build_profile/release.json --source . --build ./BUILD/K64F/GCC_ARM-RELEASE"
Tip: You could retry the last command with "-v" flag for verbose output
---
make: *** [compile] Error 255
Maybe this is because my compiler version is too high? [Warning] @,: Compiler version mismatch: Have 9.2.1; expected version >= 6.0.0 and < 7.0.0
So I downgraded my GCC_ARM toolchain to 6.3.1 but I still get the same error.
Any help would be greatly appreciated!