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: pad() got multiple values for argument 'name' #673

Closed
sayakpaul opened this issue Jun 18, 2020 · 8 comments
Closed

TypeError: pad() got multiple values for argument 'name' #673

sayakpaul opened this issue Jun 18, 2020 · 8 comments

Comments

@sayakpaul
Copy link

sayakpaul commented Jun 18, 2020

I am trying to convert the PyTorch checkpoints of tunit model to TensorFlow using ONNX. I was able to generate the ONNX files but I could not export the TensorFlow file from the ONNX files and ended up with the following error:

image

Here's the Colab Notebook that reproduces the issue. Please note that I used the animalFaces10_0_00 pre-trained checkpoints. I first copied the files from here to my personal Drive, created a folder called animalFaces10_0_00, and copied the files to that folder.

@chinhuang007
Copy link
Collaborator

There is a recent fix #650. Please install tensorflow 2.2 and do a source build for onnx-tf. The problem should be resolved.

@sayakpaul
Copy link
Author

Thanks. That solved the issue.

@Zhoushanglin100
Copy link

Is there a way I can fix this problem when using tf 1.x? I need to use tensorflow 1.x version because of some other requirements. Thanks!

@chinhuang007
Copy link
Collaborator

Yes, we will backport the fix into the tf-1.x branch. A PR will be created shortly and a new onnx-tf release should be available in about a week.

@Guanbin-Huang
Copy link

Thanks. That solved the issue.

How did you solve the issue? I changed tf to tf1.x. But I got this error. (the major issue is at the last line). Can you tell me how to convert onnx to tensorflow, plz?

TypeError Traceback (most recent call last)
in ()
7
8 model = onnx.load('reidmodel.onnx')
----> 9 tf_rep = prepare(model)

8 frames
/usr/local/lib/python3.6/dist-packages/onnx_tf/handlers/backend_handler.py in _run_tf_func(cls, tf_func, inputs, attrs)
180 attrs = cls._process_attrs(attrs)
181 return tf_func(*inputs,
--> 182 **dict([(p, attrs[p]) for p in params if p in attrs]))

TypeError: pad() got multiple values for argument 'name'

@sayakpaul
Copy link
Author

@HuangGuanbin I am in TensorFlow 2.

@Tristacheng
Copy link

Thanks. That solved the issue.

How did you solve the issue? I changed tf to tf1.x. But I got this error. (the major issue is at the last line). Can you tell me how to convert onnx to tensorflow, plz?

TypeError Traceback (most recent call last)
in ()
7
8 model = onnx.load('reidmodel.onnx')
----> 9 tf_rep = prepare(model)

8 frames
/usr/local/lib/python3.6/dist-packages/onnx_tf/handlers/backend_handler.py in _run_tf_func(cls, tf_func, inputs, attrs)
180 attrs = cls._process_attrs(attrs)
181 return tf_func(*inputs,
--> 182 **dict([(p, attrs[p]) for p in params if p in attrs]))

TypeError: pad() got multiple values for argument 'name'

have you solved it? I got same problem in tf1.15

@Tristacheng
Copy link

Thanks. That solved the issue.

How did you solve the issue? I changed tf to tf1.x. But I got this error. (the major issue is at the last line). Can you tell me how to convert onnx to tensorflow, plz?
TypeError Traceback (most recent call last)
in ()
7
8 model = onnx.load('reidmodel.onnx')
----> 9 tf_rep = prepare(model)
8 frames
/usr/local/lib/python3.6/dist-packages/onnx_tf/handlers/backend_handler.py in _run_tf_func(cls, tf_func, inputs, attrs)
180 attrs = cls._process_attrs(attrs)
181 return tf_func(*inputs,
--> 182 **dict([(p, attrs[p]) for p in params if p in attrs]))
TypeError: pad() got multiple values for argument 'name'

have you solved it? I got same problem in tf1.15

I solved it refers to 6685fd4

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

5 participants