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

cv2.error: OpenCV(4.9.0) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\resize.cpp:3789: error: (-215:Assertion failed) !dsize.empty() in function 'cv::hal::resize' #19

Open
Cokeheart opened this issue Apr 4, 2024 · 16 comments

Comments

@Cokeheart
Copy link

!!! Exception during processing !!!
Traceback (most recent call last):
File "D:\Blender_ComfyUI\ComfyUI\execution.py", line 151, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Blender_ComfyUI\ComfyUI\execution.py", line 81, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Blender_ComfyUI\ComfyUI\execution.py", line 74, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Blender_ComfyUI\ComfyUI\custom_nodes\clipseg.py", line 154, in segment_image
heatmap_resized = resize_image(heatmap, dimensions)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Blender_ComfyUI\ComfyUI\custom_nodes\clipseg.py", line 44, in resize_image
return cv2.resize(image, dimensions, interpolation=cv2.INTER_LINEAR)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
微信图片_20240403220839

@shaoheming
Copy link

i got this error too...

@HydraBucket
Copy link

I'm recieving this error too

@dimroce
Copy link

dimroce commented Apr 5, 2024

same here, So is it due to some node upgrades?

@ssuukk
Copy link

ssuukk commented Apr 7, 2024

me too!

@wer5245
Copy link

wer5245 commented Apr 7, 2024

重装插件,然后和3699错误一样的步骤改代码,再试试

@yincangshiwei
Copy link

重装插件,然后和3699错误一样的步骤改代码,再试试
怎么改

@xuxucca
Copy link

xuxucca commented Apr 19, 2024

Try installing transformers up to 4.36.0 if you can!or lower。使用较低版本的 transformers可以解决这个问题。

@shaoheming
Copy link

https://blog.csdn.net/JuMengXiaoKeTang/article/details/137383951

@GalaxyTimeMachine
Copy link

https://blog.csdn.net/JuMengXiaoKeTang/article/details/137383951

Thank you, this resolved it for me! :)

@Godorox
Copy link

Godorox commented Apr 22, 2024

https://blog.csdn.net/JuMengXiaoKeTang/article/details/137383951

I tried this solution but it doesn't work. Has anyone found another solution?

Try installing transformers up to 4.36.0 if you can! or lower. Using lower versions of transformers can solve this problem.

How can I do this?

@GalaxyTimeMachine
Copy link

https://blog.csdn.net/JuMengXiaoKeTang/article/details/137383951

I tried this solution but it doesn't work. Has anyone found another solution?

Try installing transformers up to 4.36.0 if you can! or lower. Using lower versions of transformers can solve this problem.

How can I do this?

The only change I needed to make was to the clipseg.py file. Just make that change and it should work.

Basically, edit custom_nodes/clipseg.py to this:
0c9bc471fb6c4e38a010ea4317364a83

@wangzixin1
Copy link

低级的错误,作者怎么 能用绝对路径?
OpenCV(4.9.0) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\resize.cpp:3789: error: (-215:Assertion failed) !dsize.empty() in function 'cv::hal::resize'

@yw-2020
Copy link

yw-2020 commented May 14, 2024

!!! Exception during processing!!! OpenCV(4.8.0) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\resize.cpp:3699: error: (-215:Assertion failed) !dsize.empty() in function 'cv::hal::resize'

Traceback (most recent call last):
File "E:\ComfyUI_WIN\ComfyUI\execution.py", line 151, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\ComfyUI_WIN\ComfyUI\execution.py", line 81, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\ComfyUI_WIN\ComfyUI\execution.py", line 74, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\ComfyUI_WIN\ComfyUI\custom_nodes\clipseg.py", line 154, in segment_image
heatmap_resized = resize_image(heatmap, dimensions)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\ComfyUI_WIN\ComfyUI\custom_nodes\clipseg.py", line 44, in resize_image
return cv2.resize(image, dimensions, interpolation=cv2.INTER_LINEAR)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
cv2.error: OpenCV(4.8.0) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\resize.cpp:3699: error: (-215:Assertion failed) !dsize.empty() in function 'cv::hal::resize'

how to fix??

@yw-2020
Copy link

yw-2020 commented May 14, 2024

@ioritree
Copy link

https://blog.csdn.net/JuMengXiaoKeTang/article/details/137383951

new problem after changed

Error occurred when executing Bounded Image Crop with Mask:

index is out of bounds for dimension with size 0

@JulianKingman
Copy link

Looks like this PR fixes it: https://github.com/biegert/ComfyUI-CLIPSeg/pull/18/files

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