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: 'torch._C.Node' object is not subscriptable #241

Closed
PG-9-9 opened this issue Sep 25, 2023 · 2 comments
Closed

TypeError: 'torch._C.Node' object is not subscriptable #241

PG-9-9 opened this issue Sep 25, 2023 · 2 comments

Comments

@PG-9-9
Copy link

PG-9-9 commented Sep 25, 2023

Hey Everyone I am experimenting with actionclip , and while running my config model, its showing a following error, I assume this has to be the package fix, but maybe I am wrong, Any help would be much apperciated:

TypeError: 'torch._C.Node' object is not subscriptable

Config file:
`from towhee import ops, pipe, DataCollection
from glob import glob

p = (
pipe.input('path')
.map('path', 'frames', ops.video_decode.ffmpeg())
.map('frames', ('labels', 'scores', 'features'), ops.action_classification.actionclip(model_name='clip_vit_b16'))
.output('path', 'labels', 'scores', 'features')
)

DataCollection(p('../sources/reverse_video_search/train/tap_dancing/*.mp4')).show()
`

@junjiejiangjjj
Copy link
Contributor

You can refer to openai/CLIP#79

@PG-9-9
Copy link
Author

PG-9-9 commented Sep 26, 2023

Thanks, @junjiejiangjjj. Based on the issue reference you provided, I'd like to share the fix that worked for me. For PyTorch versions greater than 2.0.0, the signature jit=False needs to be set. However, in the code sample provided above, there's no direct call to clip.py where one can add this signature. A workaround is to set the jit value to false directly within clip.py found under towhee/models/clip. I explicitly made this assignment at line 690.

@PG-9-9 PG-9-9 closed this as completed Sep 26, 2023
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

2 participants