Open qingzhenbiaojie opened 6 months ago
It seems that the API change results the problem. Try it:
with torch.no_grad():
outputs = model(**input_prc)
preds = outputs.logits.unsqueeze(1)
tensor = torch.sigmoid(preds[0][0]) # get the mask
cv 4.9.0, transformers 4.39.2 works well
commit: https://github.com/time-river/ComfyUI-CLIPSeg/commit/288a19f26d05e2d3b79ea7bfe7c4d31e26d1edd8
@time-river 感谢大哥,大哥棒!
What file must I edit to impliment these changes?
我必须编辑哪个文件才能实现这些更改?
..comfyui\custom_nodes\clipseg.py
Lol... im a noob and didnt realise I could just copy his code rather than trying to implement the slight change myself.... didn't work when I did it, worked with the copied code... definitely an issue on my end lol. Thank you, time-river and dimroce.
Replacing the clipseg.py file found in comfyui\custom_nodes\ with the one from time-river (https://github.com/time-river/ComfyUI-CLIPSeg/commit/288a19f26d05e2d3b79ea7bfe7c4d31e26d1edd8) worked for me as well. Thanks!
Try installing transformers up to 4.36.0 if you can!
Try installing transformers up to 4.36.0 if you can!
Thank you so much! It was transformers all along! Modifying the original clipseg.py
did not fix it for me.
Folks, anyone reading this and still having issues, this solved it for me:
pip uninstall -y transformers
pip install transformers<=4.36.0
(PS This will also change the version of your tokenizer.)
how to solve this problem?????