ZHO-ZHO-ZHO / ComfyUI-YoloWorld-EfficientSAM

Unofficial implementation of YOLO-World + EfficientSAM for ComfyUI
GNU General Public License v3.0
618 stars 57 forks source link

Can't get attribute 'WorldModel' on <module 'ultralytics.nn.tasks' from 'E:\\ComfyUI-aki-v1.3\\python\\lib\\site-packages\\ultralytics\\nn\\tasks.py'> #46

Open pzc163 opened 6 months ago

pzc163 commented 6 months ago

!!! Exception during processing!!! Can't get attribute 'WorldModel' on <module 'ultralytics.nn.tasks' from 'E:\ComfyUI-aki-v1.3\python\lib\site-packages\ultralytics\nn\tasks.py'> Traceback (most recent call last): File "E:\ComfyUI-aki-v1.3\execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) File "E:\ComfyUI-aki-v1.3\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-aki-v1.3\execution.py", line 74, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) File "E:\ComfyUI-aki-v1.3\custom_nodes\ComfyUI-YoloWorld-EfficientSAM\YOLO_WORLD_EfficientSAM.py", line 70, in load_yolo_world_model YOLO_WORLD_MODEL = YOLOWorld(model_id=yolo_world_model) File "E:\ComfyUI-aki-v1.3\python\lib\site-packages\inference\models\yolo_world\yolo_world.py", line 36, in init self.model = YOLO(self.cache_file("yolo-world.pt")) File "E:\ComfyUI-aki-v1.3\python\lib\site-packages\ultralytics\engine\model.py", line 95, in init self._load(model, task) File "E:\ComfyUI-aki-v1.3\python\lib\site-packages\ultralytics\engine\model.py", line 161, in _load self.model, self.ckpt = attempt_load_one_weight(weights) File "E:\ComfyUI-aki-v1.3\python\lib\site-packages\ultralytics\nn\tasks.py", line 700, in attempt_load_one_weight ckpt, weight = torch_safe_load(weight) # load ckpt File "E:\ComfyUI-aki-v1.3\python\lib\site-packages\ultralytics\nn\tasks.py", line 634, in torch_safe_load return torch.load(file, map_location="cpu"), file # load File "E:\ComfyUI-aki-v1.3\python\lib\site-packages\torch\serialization.py", line 1014, in load return _load(opened_zipfile, File "E:\ComfyUI-aki-v1.3\python\lib\site-packages\torch\serialization.py", line 1422, in _load result = unpickler.load() File "E:\ComfyUI-aki-v1.3\python\lib\site-packages\torch\serialization.py", line 1415, in find_class return super().find_class(mod_name, name) AttributeError: Can't get attribute 'WorldModel' on <module 'ultralytics.nn.tasks' from 'E:\ComfyUI-aki-v1.3\python\lib\site-packages\ultralytics\nn\tasks.py'> 微信截图_20240510113313 image

ComfyUI-YoloWorld-EfficientSAM node vision is 0416,when run yolo world model loader occur this error,anyone knows how fix it?thx so much!

Lyu2024 commented 5 months ago

the same thing happened on my workflow,can anyone help me ? how can i fix it?

Solaire111 commented 3 months ago

Did u fix it? I also have this problem

Solaire111 commented 3 months ago

the same thing happened on my workflow,can anyone help me ? how can i fix it?

Did u fix it? I also have this problem

vayron commented 3 months ago

I just encountered the same issue. It turns out that Ultralytics couldn't find “WorldModel”. After checking my local version 8.0.3, I promptly upgraded to the latest version, and the issue was resolved.

pip install ultralytics==8.2.70

Don't forget to download efficient_sam_s_cpu.jit or efficient_sam_s_gpu.jit to your local machine.

~/ComfyUI/custom_nodes/ComfyUI-YoloWorld-EfficientSAM/efficient_sam_s_cpu.jit

Download link https://huggingface.co/camenduru/YoloWorld-EfficientSAM/tree/main

WX20240731-133703@2x 2