Skip to content

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

@Comet-hash

Description

@Comet-hash

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triagePRs or issues that need to be investigated by maintainers to find the right assignees to address ittype: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions