biegert / ComfyUI-CLIPSeg

ComfyUI CLIPSeg
Apache License 2.0
203 stars 36 forks source link

Regarding OpenCV3699, cv::hal::resize #17

Open qingzhenbiaojie opened 6 months ago

qingzhenbiaojie commented 6 months ago

QQ截图20240330191143

how to solve this problem?????

time-river commented 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

qingzhenbiaojie commented 6 months ago

@time-river 感谢大哥,大哥棒!

HydraBucket commented 6 months ago

What file must I edit to impliment these changes?

dimroce commented 6 months ago

我必须编辑哪个文件才能实现这些更改?

..comfyui\custom_nodes\clipseg.py

HydraBucket commented 6 months ago

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.

CatDadChris commented 6 months ago

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!

xuxucca commented 5 months ago

Try installing transformers up to 4.36.0 if you can!

LichAcademy commented 4 months ago

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.)