ltdrdata / ComfyUI-Impact-Pack

Custom nodes pack for ComfyUI This custom node helps to conveniently enhance images through Detector, Detailer, Upscaler, Pipe, and more.
GNU General Public License v3.0
1.89k stars 183 forks source link

pytorch 2.4.1 suddenly give this crash report :**Exception Type:** NotImplementedError - **Exception Message:** Could not run 'torchvision::nms' with arguments from the 'CUDA' backend. #739

Closed gdx09090909 closed 2 months ago

gdx09090909 commented 2 months ago

ComfyUI Error Report

Error Details

CPU: registered at C:\actions-runner_work\vision\vision\pytorch\vision\torchvision\csrc\ops\cpu\nms_kernel.cpp:112 [kernel] Meta: registered at /dev/null:154 [kernel] QuantizedCPU: registered at C:\actions-runner_work\vision\vision\pytorch\vision\torchvision\csrc\ops\quantized\cpu\qnms_kernel.cpp:124 [kernel] BackendSelect: fallthrough registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\core\BackendSelectFallbackKernel.cpp:3 [backend fallback] Python: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\core\PythonFallbackKernel.cpp:153 [backend fallback] FuncTorchDynamicLayerBackMode: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\functorch\DynamicLayer.cpp:497 [backend fallback] Functionalize: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\FunctionalizeFallbackKernel.cpp:349 [backend fallback] Named: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\core\NamedRegistrations.cpp:7 [backend fallback] Conjugate: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\ConjugateFallback.cpp:17 [backend fallback] Negative: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\native\NegateFallback.cpp:18 [backend fallback] ZeroTensor: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\ZeroTensorFallback.cpp:86 [backend fallback] ADInplaceOrView: fallthrough registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\core\VariableFallbackKernel.cpp:86 [backend fallback] AutogradOther: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\core\VariableFallbackKernel.cpp:53 [backend fallback] AutogradCPU: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\core\VariableFallbackKernel.cpp:57 [backend fallback] AutogradCUDA: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\core\VariableFallbackKernel.cpp:65 [backend fallback] AutogradXLA: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\core\VariableFallbackKernel.cpp:69 [backend fallback] AutogradMPS: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\core\VariableFallbackKernel.cpp:77 [backend fallback] AutogradXPU: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\core\VariableFallbackKernel.cpp:61 [backend fallback] AutogradHPU: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\core\VariableFallbackKernel.cpp:90 [backend fallback] AutogradLazy: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\core\VariableFallbackKernel.cpp:73 [backend fallback] AutogradMeta: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\core\VariableFallbackKernel.cpp:81 [backend fallback] Tracer: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\torch\csrc\autograd\TraceTypeManual.cpp:297 [backend fallback] AutocastCPU: registered at C:\actions-runner_work\vision\vision\pytorch\vision\torchvision\csrc\ops\autocast\nms_kernel.cpp:34 [kernel] AutocastXPU: fallthrough registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\autocast_mode.cpp:351 [backend fallback] AutocastCUDA: registered at C:\actions-runner_work\vision\vision\pytorch\vision\torchvision\csrc\ops\autocast\nms_kernel.cpp:27 [kernel] FuncTorchBatched: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\functorch\LegacyBatchingRegistrations.cpp:731 [backend fallback] BatchedNestedTensor: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\functorch\LegacyBatchingRegistrations.cpp:758 [backend fallback] FuncTorchVmapMode: fallthrough registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\functorch\VmapModeRegistrations.cpp:27 [backend fallback] Batched: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\LegacyBatchingRegistrations.cpp:1075 [backend fallback] VmapMode: fallthrough registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\VmapModeRegistrations.cpp:33 [backend fallback] FuncTorchGradWrapper: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\functorch\TensorWrapper.cpp:207 [backend fallback] PythonTLSSnapshot: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\core\PythonFallbackKernel.cpp:161 [backend fallback] FuncTorchDynamicLayerFrontMode: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\functorch\DynamicLayer.cpp:493 [backend fallback] PreDispatch: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\core\PythonFallbackKernel.cpp:165 [backend fallback] PythonDispatcher: registered at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\core\PythonFallbackKernel.cpp:157 [backend fallback]

Stack Trace

  File "D:\comfyui\ComfyUI-aki-v1.3\execution.py", line 323, in execute
    output_data, output_ui, has_subgraph = get_output_data(obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)

  File "D:\comfyui\ComfyUI-aki-v1.3\execution.py", line 198, in get_output_data
    return_values = _map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)

  File "D:\comfyui\ComfyUI-aki-v1.3\execution.py", line 169, in _map_node_over_list
    process_inputs(input_dict, i)

  File "D:\comfyui\ComfyUI-aki-v1.3\execution.py", line 158, in process_inputs
    results.append(getattr(obj, func)(**inputs))

  File "D:\comfyui\ComfyUI-aki-v1.3\custom_nodes\ComfyUI-Impact-Pack\modules\impact\impact_pack.py", line 579, in doit
    enhanced_img, cropped_enhanced, cropped_enhanced_alpha, mask, cnet_pil_list = FaceDetailer.enhance_face(

  File "D:\comfyui\ComfyUI-aki-v1.3\custom_nodes\ComfyUI-Impact-Pack\modules\impact\impact_pack.py", line 513, in enhance_face
    segs = bbox_detector.detect(image, bbox_threshold, bbox_dilation, bbox_crop_factor, drop_size, detailer_hook=detailer_hook)

  File "D:\comfyui\ComfyUI-aki-v1.3\custom_nodes\ComfyUI-Impact-Pack\impact_subpack\impact\subcore.py", line 127, in detect
    detected_results = inference_bbox(self.bbox_model, core.tensor2pil(image), threshold)

  File "D:\comfyui\ComfyUI-aki-v1.3\custom_nodes\ComfyUI-Impact-Pack\impact_subpack\impact\subcore.py", line 33, in inference_bbox
    pred = model(image, conf=confidence, device=device)

  File "D:\comfyui\ComfyUI-aki-v1.3\python\lib\site-packages\ultralytics\engine\model.py", line 98, in __call__
    return self.predict(source, stream, **kwargs)

  File "D:\comfyui\ComfyUI-aki-v1.3\python\lib\site-packages\ultralytics\engine\model.py", line 239, in predict
    return self.predictor.predict_cli(source=source) if is_cli else self.predictor(source=source, stream=stream)

  File "D:\comfyui\ComfyUI-aki-v1.3\python\lib\site-packages\ultralytics\engine\predictor.py", line 198, in __call__
    return list(self.stream_inference(source, model, *args, **kwargs))  # merge list of Result into one

  File "D:\comfyui\ComfyUI-aki-v1.3\python\lib\site-packages\torch\utils\_contextlib.py", line 36, in generator_context
    response = gen.send(None)

  File "D:\comfyui\ComfyUI-aki-v1.3\python\lib\site-packages\ultralytics\engine\predictor.py", line 269, in stream_inference
    self.results = self.postprocess(preds, im, im0s)

  File "D:\comfyui\ComfyUI-aki-v1.3\python\lib\site-packages\ultralytics\models\yolo\detect\predict.py", line 25, in postprocess
    preds = ops.non_max_suppression(preds,

  File "D:\comfyui\ComfyUI-aki-v1.3\python\lib\site-packages\ultralytics\utils\ops.py", line 238, in non_max_suppression
    i = torchvision.ops.nms(boxes, scores, iou_thres)  # NMS

  File "D:\comfyui\ComfyUI-aki-v1.3\python\lib\site-packages\torchvision\ops\boxes.py", line 41, in nms
    return torch.ops.torchvision.nms(boxes, scores, iou_threshold)

  File "D:\comfyui\ComfyUI-aki-v1.3\python\lib\site-packages\torch\_ops.py", line 1061, in __call__
    return self_._op(*args, **(kwargs or {}))

System Information

ltdrdata commented 2 months ago

That occurs when there are incompatible versions between torch and other packages that depend on torch. Uninstall torch and torch-related packages (torchsde, torchvision torchaudio, ..), then reinstall them.