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

TypeError: Failed to convert elements of [None] to Tensor. Consider casting elements to a supported type. #1064

Open
surajpandey353 opened this issue Aug 11, 2023 · 0 comments

Comments

@surajpandey353
Copy link

Hi,

I am trying to export a torch QAT model (ONNX -> tf ->TFLite). I have the ONNX model and 12 tf_rep = prepare(onnx_model, strict = False) ---> 13 tf_rep.export_graph(tf_model_path) seems to be creating the issue. Although similar issue with the <class.List> was mentioned before #889, there is similar issue which is arising at QLinearConv . This issue persists.

Error:
'''
TypeError: in user code:

File "/home/pandey/anaconda3/envs/e2enc/lib/python3.9/site-packages/onnx_tf/backend_tf_module.py", line 99, in __call__  *
    output_ops = self.backend._onnx_node_to_tensorflow_op(onnx_node,
File "/home/pandey/anaconda3/envs/e2enc/lib/python3.9/site-packages/onnx_tf/backend.py", line 347, in _onnx_node_to_tensorflow_op  *
    return handler.handle(node, tensor_dict=tensor_dict, strict=strict)
File "/home/pandey/anaconda3/envs/e2enc/lib/python3.9/site-packages/onnx_tf/handlers/handler.py", line 59, in handle  *
    return ver_handle(node, **kwargs)
File "/home/pandey/anaconda3/envs/e2enc/lib/python3.9/site-packages/onnx_tf/handlers/backend/q_linear_conv.py", line 45, in version_10  *
    w_zero_point = tf.fill([x.shape[1]], w_zero_point)

TypeError: Failed to convert elements of [None] to Tensor. Consider casting elements to a supported type. See https://www.tensorflow.org/api_docs/python/tf/dtypes for supported TF dtypes.

'''
Python, ONNX, ONNX-TF, Tensorflow version

Python version: 3.9.0
ONNX version: 1.14.0 
ONNX-TF version: 1.10.0
Tensorflow version: 2.12.0

Could someone help me understand what is causing this issue?

Thanks!

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