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

Error occurred when executing Yoloworld_ESAM_Zho: The following operation failed in the TorchScript interpreter. #74

Open
0002kgHg opened this issue Jul 12, 2024 · 10 comments

Comments

@0002kgHg
Copy link

Error occurred when executing Yoloworld_ESAM_Zho:

The following operation failed in the TorchScript interpreter.
Traceback of TorchScript (most recent call last):
RuntimeError: vector::_M_range_check: __n (which is 18446744073709551615) >= this->size() (which is 3)

File "/comfyui/execution.py", line 151, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
File "/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 "/comfyui/execution.py", line 74, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
File "/comfyui/custom_nodes/ComfyUI-YoloWorld-EfficientSAM/YOLO_WORLD_EfficientSAM.py", line 149, in yoloworld_esam_image
detections.mask = inference_with_boxes(
File "/comfyui/custom_nodes/ComfyUI-YoloWorld-EfficientSAM/utils/efficient_sam.py", line 59, in inference_with_boxes
mask = inference_with_box(image, box, model, device)
File "/comfyui/custom_nodes/ComfyUI-YoloWorld-EfficientSAM/utils/efficient_sam.py", line 28, in inference_with_box
predicted_logits, predicted_iou = model(
File "/root/anaconda3/envs/ComfyUI/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/root/anaconda3/envs/ComfyUI/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)

更新完用不聊了。

@Alex-Ning
Copy link

Try disable ComfyUI-Easy-Use

@xueqing0622
Copy link

Easy use是不能卸载的系列,有没有其他办法

@0002kgHg
Copy link
Author

I don't know what happened, but it's already useable.

@xueqing0622
Copy link

I don't know what happened, but it's already useable.

怎么修复的

@0002kgHg
Copy link
Author

I don't know what happened, but it's already useable.

怎么修复的

我弄半天没修复,后面就没搞这个工作流了。

@LeoMusk
Copy link

LeoMusk commented Jul 29, 2024

一样的问题,有解么?

@chaohuei2020
Copy link

周大哥,怎那么解决这个问题啊

Error occurred when executing Yoloworld_ESAM_Zho:

The following operation failed in the TorchScript interpreter.
Traceback of TorchScript (most recent call last):
RuntimeError: invalid vector subscript

File "D:\comfyui-aik\ComfyUI-aki-v1.3\execution.py", line 152, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
File "D:\comfyui-aik\ComfyUI-aki-v1.3\execution.py", line 82, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
File "D:\comfyui-aik\ComfyUI-aki-v1.3\execution.py", line 75, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
File "D:\comfyui-aik\ComfyUI-aki-v1.3\custom_nodes\ComfyUI-YoloWorld-EfficientSAM\YOLO_WORLD_EfficientSAM.py", line 149, in yoloworld_esam_image
detections.mask = inference_with_boxes(
File "D:\comfyui-aik\ComfyUI-aki-v1.3\custom_nodes\ComfyUI-YoloWorld-EfficientSAM\utils\efficient_sam.py", line 59, in inference_with_boxes
mask = inference_with_box(image, box, model, device)
File "D:\comfyui-aik\ComfyUI-aki-v1.3\custom_nodes\ComfyUI-YoloWorld-EfficientSAM\utils\efficient_sam.py", line 28, in inference_with_box
predicted_logits, predicted_iou = model(
File "D:\comfyui-aik\ComfyUI-aki-v1.3\python\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "D:\comfyui-aik\ComfyUI-aki-v1.3\python\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)

@18458041181
Copy link

Error occurred when executing Yoloworld_ESAM_Zho:

The following operation failed in the TorchScript interpreter.
Traceback of TorchScript, serialized code (most recent call last):
File "code/torch/d2go/projects/sam/model/sam.py", line 34, in forward
image_embeddings = image_embeddings0
else:
image_embeddings1 = (self).get_image_embeddings(batched_images, )

image_embeddings = image_embeddings1
H = self.H
File "code/__torch__/d2go/projects/sam/model/sam.py", line 127, in get_image_embeddings
def get_image_embeddings(self: __torch__.d2go.projects.sam.model.sam.Sam,
batched_images: Tensor) -> List[Tensor]:
batched_images1 = (self).preprocess(batched_images, )
~~~~~~~~~~~~~~~~ <--- HERE
image_encoder = self.image_encoder
_59 = (image_encoder).forward(batched_images1, )
File "code/__torch__/d2go/projects/sam/model/sam.py", line 241, in preprocess
x0 = x
pixel_mean = self.pixel_mean
_94 = torch.sub(x0, pixel_mean)
~~~~~~~~~ <--- HERE
pixel_std = self.pixel_std
return torch.div(_94, pixel_std)

Traceback of TorchScript, original code (most recent call last):
File "/mnt/xarfuse/uid-462794/d7062d46-seed-7d5fdcd1-471c-4e32-b226-19878c868d15-ns-4026535078/d2go/projects/sam/model/sam.py", line 646, in forward
)
else:
image_embeddings = self.get_image_embeddings(batched_images)
~~~~~~~~~~~~~~~~~~~~~~~~~ <--- HERE

return self.predict_masks(
File "/mnt/xarfuse/uid-462794/d7062d46-seed-7d5fdcd1-471c-4e32-b226-19878c868d15-ns-4026535078/d2go/projects/sam/model/sam.py", line 592, in get_image_embeddings
The last embedding corresponds to the final layer.
"""
batched_images = self.preprocess(batched_images)
~~~~~~~~~~~~~~~ <--- HERE
return self.image_encoder(batched_images)
File "/mnt/xarfuse/uid-462794/d7062d46-seed-7d5fdcd1-471c-4e32-b226-19878c868d15-ns-4026535078/d2go/projects/sam/model/sam.py", line 672, in preprocess
mode="bilinear",
)
return (x - self.pixel_mean) / self.pixel_std
~~~~~~~~~~~~~~~~~~~ <--- HERE
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu!


File "D:\ComfyUI_windows_portable\ComfyUI\execution.py", line 152, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ComfyUI_windows_portable\ComfyUI\execution.py", line 82, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ComfyUI_windows_portable\ComfyUI\execution.py", line 75, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-YoloWorld-EfficientSAM\YOLO_WORLD_EfficientSAM.py", line 149, in yoloworld_esam_image
detections.mask = inference_with_boxes(
^^^^^^^^^^^^^^^^^^^^^
File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-YoloWorld-EfficientSAM\utils\efficient_sam.py", line 59, in inference_with_boxes
mask = inference_with_box(image, box, model, device)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-YoloWorld-EfficientSAM\utils\efficient_sam.py", line 28, in inference_with_box
predicted_logits, predicted_iou = model(
^^^^^^
File "D:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1532, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1541, in _call_impl
return forward_call(*args, **kwargs)

@zhoumengchao
Copy link

Error occurred when executing Yoloworld_ESAM_Zho:

The following operation failed in the TorchScript interpreter.
Traceback of TorchScript (most recent call last):
RuntimeError: vector::_M_range_check: __n (which is 18446744073709551615) >= this->size() (which is 3)
怎么解决这个问题呢

@FruitPigFoot
Copy link

@zhoumengchao i have the exact same error. You found any solutions?

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

8 participants