yolov5-face-landmarks-opencv-v2 icon indicating copy to clipboard operation
yolov5-face-landmarks-opencv-v2 copied to clipboard

error when convert to onnx

Open AlexBlack2202 opened this issue 3 years ago • 10 comments

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?

AlexBlack2202 avatar Apr 01 '22 12:04 AlexBlack2202

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 avatar Jun 07 '22 02:06 QIANXUNZDL123

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 avatar Jun 23 '22 12:06 AndreKev

Updates.

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

AndreKev avatar Jun 23 '22 13:06 AndreKev

Updates.

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

Thank you

AlexBlack2202 avatar Jun 24 '22 01:06 AlexBlack2202

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

QIANXUNZDL123 avatar Jun 25 '22 08:06 QIANXUNZDL123

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 https://github.com/hpc203/yolov5-face-landmarks-opencv-v2/issues/7#issuecomment-1166230583, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUUSCLIBC37UPMZKVSHDFZ3VQ3BPZANCNFSM5SITAOGA . You are receiving this because you commented.Message ID: @.***>

AndreKev avatar Jun 25 '22 08:06 AndreKev

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

QIANXUNZDL123 avatar Jun 25 '22 11:06 QIANXUNZDL123

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 ?

AndreKev avatar Jun 28 '22 07:06 AndreKev

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!!!

QIANXUNZDL123 avatar Jun 29 '22 06:06 QIANXUNZDL123

Oh yeah ! (◠‿◕)

I think the issue can be closed

On Wed, Jun 29, 2022, 7:09 AM zdl @.***> wrote:

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!!!

— Reply to this email directly, view it on GitHub https://github.com/hpc203/yolov5-face-landmarks-opencv-v2/issues/7#issuecomment-1169572332, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUUSCLMM5UUFZ77KUJ6KX4LVRPSCVANCNFSM5SITAOGA . You are receiving this because you commented.Message ID: @.***>

AndreKev avatar Jun 29 '22 06:06 AndreKev