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

error when convert to onnx #7

Open
AlexBlack2202 opened this issue Apr 1, 2022 · 10 comments
Open

error when convert to onnx #7

AlexBlack2202 opened this issue Apr 1, 2022 · 10 comments

Comments

@AlexBlack2202
Copy link

i run main_export_onnx.py in python3 and it show error

File "main_export_onnx.py", line 89, in forward
x[0] = x[0].view(-1, self.no)
TypeError: 'tuple' object does not support item assignment

how can i fix this?

@QIANXUNZDL123
Copy link

i run main_export_onnx.py in python3 and it show error

File "main_export_onnx.py", line 89, in forward x[0] = x[0].view(-1, self.no) TypeError: 'tuple' object does not support item assignment

how can i fix this?

你好 我也遇到这种得问题 请问你解决了吗

@AndreKev
Copy link

I solved this issue. at line 89 insert :

x = x[1]

x is a list and it's second element is the one containing the triple <class 'torch.Tensor'>
it will be ok

@AndreKev
Copy link

Updates.

After this bug fixed, the ONNX file is located in the directory precise in the main_extraction code file.

@AlexBlack2202
Copy link
Author

Updates.

After this bug fixed, the ONNX file is located in the directory precise in the main_extraction code file.

Thank you

@QIANXUNZDL123
Copy link

Updates.

After this bug fixed, the ONNX file is located in the directory precise in the main_extraction code file.

Hi i have other problems,at line 89 inset x=x[1] but have other problems:
image

i also delete line 90 and line 91, also have problems ,so You can show me your code? thank you

@AndreKev
Copy link

AndreKev commented Jun 25, 2022 via email

@QIANXUNZDL123
Copy link

What's the error you have ?

On Sat, Jun 25, 2022, 09:46 zdl @.> wrote: Updates. After this bug fixed, the ONNX file is located in the directory precise in the main_extraction code file. Hi i have other problems,at line 89 inset x=x[1] but have other problems: [image: image] https://user-images.githubusercontent.com/46549527/175765780-45b15813-e956-4757-9e30-9a9d6bca5261.png i also delete line 90 and line 91, also have problems ,so You can show me your code? thank you — Reply to this email directly, view it on GitHub <#7 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUUSCLIBC37UPMZKVSHDFZ3VQ3BPZANCNFSM5SITAOGA . You are receiving this because you commented.Message ID: @.>

image

@AndreKev
Copy link

AndreKev commented Jun 28, 2022

Seems you deleted a line of code. x[0] = x[0].view(-1, self.no)
It should look like :
x = x[1]
x[0] = x[0].view(-1, self.no)
x[1] = x[1].view(-1, self.no)
x[2] = x[2].view(-1, self.no)

What do you have ?

@QIANXUNZDL123
Copy link

Seems you deleted a line of code. x[0] = x[0].view(-1, self.no) It should look like : x = x[1] x[0] = x[0].view(-1, self.no) x[1] = x[1].view(-1, self.no) x[2] = x[2].view(-1, self.no)

What do you have ?

thank you very much!! add x = x[1], The problem goes away!!!

@AndreKev
Copy link

AndreKev commented Jun 29, 2022 via email

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

3 participants