Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vitis AI GPU Docker(TensorFlow 1.x) vai_q_tensorflow command errors and thier solution #1464

Open
TeppeiT opened this issue Sep 13, 2024 · 0 comments

Comments

@TeppeiT
Copy link

TeppeiT commented Sep 13, 2024

Hi

In the Vitis AI 3.0 repository, I built the GPU Docker for TensorFlow 1.x and after launching it,
I got the following SyntaxError when running the vai_q_tensorflow command.

It was a SyntaxError and we solved it by fixing some source code, so please consider fixing it if possible.

・Error

vitis-ai-user@xxx:/workspace$ vai_q_tensorflow --help
Traceback (most recent call last):
  File "/opt/vitis_ai/conda/envs/vitis-ai-tensorflow/bin/vai_q_tensorflow", line 7, in <module>
    from vai_q_tensorflow.python.decent_q import run_main
  File "/opt/vitis_ai/conda/envs/vitis-ai-tensorflow/lib/python3.6/site-packages/vai_q_tensorflow/__init__.py", line 38, in <module>
    from vai_q_tensorflow.python.decent_q import inspect
  File "/opt/vitis_ai/conda/envs/vitis-ai-tensorflow/lib/python3.6/site-packages/vai_q_tensorflow/python/decent_q.py", line 91, in <module>
    from progressbar import ProgressBar
  File "/opt/vitis_ai/conda/envs/vitis-ai-tensorflow/lib/python3.6/site-packages/progressbar/__init__.py", line 3, in <module>
    from .utils import (
  File "/opt/vitis_ai/conda/envs/vitis-ai-tensorflow/lib/python3.6/site-packages/progressbar/utils.py", line 9, in <module>
    from python_utils.time import timedelta_to_seconds, epoch, format_time
  File "/opt/vitis_ai/conda/envs/vitis-ai-tensorflow/lib/python3.6/site-packages/python_utils/__init__.py", line 1, in <module>
    from . import (
  File "/opt/vitis_ai/conda/envs/vitis-ai-tensorflow/lib/python3.6/site-packages/python_utils/converters.py", line 89
    if match := regexp.search(input_):
              ^
SyntaxError: invalid syntax

I changed “:=” to “==” in lines 89 and 170 of converters.py and the error was resolved.

・L89

 87     try:
 88         if regexp and input_:
 89             if match == regexp.search(input_):
 90             #if match := regexp.search(input_):
 91                 input_ = match.groups()[-1]

・L170

168     try:
169         if regexp:
170             if match == regexp.search(input_):
171             #if match := regexp.search(input_):
172                 input_ = match.group(1)

・after chenged

vitis-ai-user@xxx:/workspace$ vai_q_tensorflow --help
usage:
    usage: vai_q_tensorflow command [Options]

    examples:
      show help       : vai_q_tensorflow --help
      quantize a model: vai_q_tensorflow quantize --input_frozen_graph frozen_graph.pb --input_nodes xxx --output_nodes yyy --input_shapes zzz --input_fn module.calib_input
      inspect a model : vai_q_tensorflow inspect --input_frozen_graph frozen_graph.pb
      dump quantized model : vai_q_tensorflow dump --input_frozen_graph quantize_results/quantize_eval_model.pb --input_fn module.dump_input
      update old quantized model: vai_q_tensorflow update --input_frozen_graph quantize_results/quantize_eval_model.pb


Xilinx's Quantization ToolsVai_q_tensorflow 3.0.0-dev-gpu build for Tensorflow
1.15.2 git version d2e041a

positional arguments:
  {quantize,inspect,dump,deploy,update}
                        Specify a command for vai_q_tensorflow

optional arguments:
  -h, --help            show this help message and exit
  --version             show program's version number and exit
  --mode {frozen,train,eval}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant