mirror of
https://github.com/openai/CLIP.git
synced 2026-11-05 01:37:26 +00:00
[GH-ISSUE #79] TypeError: 'torch._C.Node' object is not subscriptable #71
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
openai/CLIP#71
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @lonngxiang on GitHub (Apr 7, 2021).
Original GitHub issue: https://github.com/openai/CLIP/issues/79
Traceback (most recent call last):
File "D:/openai/CLIP/test1.py", line 7, in
model, preprocess = clip.load("ViT-B/32", device=device)
File "D:\openai\CLIP\clip\clip.py", line 133, in load
model.apply(patch_device)
File "D:\conda\envs\my_pytorch\lib\site-packages\torch\nn\modules\module.py", line 445, in apply
module.apply(fn)
File "D:\conda\envs\my_pytorch\lib\site-packages\torch\nn\modules\module.py", line 445, in apply
module.apply(fn)
File "D:\conda\envs\my_pytorch\lib\site-packages\torch\nn\modules\module.py", line 446, in apply
fn(self)
File "D:\openai\CLIP\clip\clip.py", line 130, in patch_device
if "value" in node.attributeNames() and str(node["value"]).startswith("cuda"):
TypeError: 'torch._C.Node' object is not subscriptable
@jongwook commented on GitHub (Apr 8, 2021):
Likely related to PyTorch 1.8. Please try loading with
jit=Falseor stick to torch 1.7.1. See #49 for more info.@maksimovkonstantin commented on GitHub (Oct 18, 2021):
@jongwook This very unclear and strange solution helped me https://github.com/microsoft/nni/issues/2574 - so If someone will face the same problem - just import torchvision
@fuqichen1998 commented on GitHub (Apr 19, 2023):
This doesn't work for me.
@samuela commented on GitHub (May 24, 2023):
FWIW I've found the same error on Ubuntu 20.04, with PyTorch 2.0.0 and CLIP
a9b1bf5920.Update: setting
jit=Falsefixes it for me@dreamlychina commented on GitHub (Jun 7, 2023):
thanks, It is helpful for me。
@jamt9000 commented on GitHub (Jul 6, 2023):
For torch 2.0.0 this is working to monkeypatch the subscript operator: