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

[Bug] TensorFlow Model Conversion Error and Build Error on TVM Runtime for Ultra96v2 #17559

Open
Comet-hash opened this issue Dec 15, 2024 · 0 comments
Labels
needs-triage PRs or issues that need to be investigated by maintainers to find the right assignees to address it type: bug

Comments

@Comet-hash
Copy link

Comet-hash commented Dec 15, 2024

Our goal is to run AI models trained in TensorFlow on a Xilinx Ultra96v2 FPGA board. Following the instructions provided in the linked guide, we are executing AI models compiled with TVM using the Vitis AI DPU.
The tools and versions currently being used are as follows:
• PYNQ: Version 3.0.1
• Vitis AI: Version 2.5
• TVM: Version 0.19

Below are the issues we need help resolving:

  1. TensorFlow Model Conversion Error
    Following the example (https://tvm.apache.org/docs/how_to/compile_models/from_tensorflow.html), when converting a TensorFlow AI model into a relay model using the tvm.relay.frontend.from_tensorflow function, we encounter the error:
    "TypeError: dense() got an unexpected keyword argument 'grad_a'."
    We believe this issue arises because of differences in TensorFlow model arguments introduced with the transition from TensorFlow 1 to TensorFlow 2 (Calling a Dense layer fails when it is created with kernel_initializer=tf.keras.initializers.Zeros() tensorflow/tensorflow#24573). Additionally, it seems that the TVM version being used does not support TensorFlow 2 (https://discuss.tvm.apache.org/t/how-to-import-native-tensorflow2-trained-model-into-tvm-relay/8847/3). Could you confirm the TensorFlow version compatible with the TVM version we are using?

  2. Build Error on TVM Runtime for Ultra96v2
    Following the steps in the linked guide (https://tvm.apache.org/docs/how_to/deploy/vitis_ai.html), we built TVM on the Ultra96v2. However, when importing the library with import tvm.relay as relay, the error occurs:
    "AttributeError: module 'tvm.relay._ffi_api' has no attribute 'Any'."
    We suspect this is due to a dependency issue, where a specific library might be missing during runtime installation (https://discuss.tvm.apache.org/t/attributeerror-when-import-tvm-relay/3305/5). If this is the case, could you provide additional setup instructions or recommend compatible versions? If this assumption is incorrect, please advise on how to identify the root cause and resolve this issue.

@Comet-hash Comet-hash added needs-triage PRs or issues that need to be investigated by maintainers to find the right assignees to address it type: bug labels Dec 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage PRs or issues that need to be investigated by maintainers to find the right assignees to address it type: bug
Projects
None yet
Development

No branches or pull requests

1 participant