model51.py-20170919

本文介绍了一种使用Python实现的视频监控系统,该系统利用OpenCV进行背景分割、目标检测和跟踪。通过四个不同摄像头捕获的视频流,系统能够识别并绘制运动中的物体,并进行简单的距离估算。
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 18 14:12:01 2017

@author: vicky
"""

import numpy as np
import cv2
import matplotlib.pyplot as plt
import sys
from matplotlib.animation import FuncAnimation
from matplotlib import animation

cap1 = cv2.VideoCapture('/Users/vicky/Desktop/第五问视频/4p-c0.mp4')
cap2 = cv2.VideoCapture('/Users/vicky/Desktop/第五问视频/4p-c1.mp4')
cap3 = cv2.VideoCapture('/Users/vicky/Desktop/第五问视频/4p-c2.mp4')
cap4 = cv2.VideoCapture('/Users/vicky/Desktop/第五问视频/4p-c3.mp4')
#创建一个3*3的椭圆核
kernel = cv2.getStructuringElement(cv2.MORPH_ELLIPSE,(5,5))#形态学运算,膨胀
#创建BackgroundSubtractorMOG2
fgbg = cv2.createBackgroundSubtractorMOG2()#视频的背景分割,Foreground Segmentation Algorithm
size = (int(cap1.get(cv2.CAP_PROP_FRAME_WIDTH)), int(cap1.get(cv2.CAP_PROP_FRAME_HEIGHT)))
fourcc=cv2.VideoWriter_fourcc('X','V','I','D')
out = cv2.VideoWriter('output.avi',fourcc,20.0,size)

Z=[]
firstFrame1 = None
firstFrame2 = None
firstFrame3 = None
firstFrame4 = None

top=np.zeros((56,56))

fig = plt.figure()
ax1 = fig.add_subplot(1, 1, 1, xlim=(0, 30), ylim=(0, 45))
line, = ax1.plot([], [], 'ro')

while(1):
    ret1, frame1 = cap1.read(0)
    ret2, frame2 = cap2.read(0)
    ret3, frame3 = cap3.read(0)
    ret4, frame4 = cap4.read(0)
    if ret1 == True:
        fgmask1 = fgbg.apply(frame1)
        fgmask1 = cv2.morphologyEx(fgmask1, cv2.MORPH_OPEN, kernel)
        blured1 = cv2.bilateralFilter(fgmask1, 10, 5, 5)
        blured2 = cv2.GaussianBlur(fgmask1, (3, 3), 0)
        fgmask1 = blured2
        fgmask1 = closing = cv2.morphologyEx(fgmask1, cv2.MORPH_CLOSE, kernel)
        #寻找视频中的轮廓
        im1, contours1, hierarchy1 = cv2.findContours(fgmask1, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)

        for c in contours1:
            perimeter = cv2.arcLength(c,True)
            #Z.append(perimeter)
            if perimeter >250:   
                # CV2.moments會傳回一系列的moments值,我們只要知道中點X, Y的取得方式是如下進行即可。
                M1 = cv2.moments(c)
                print
                cX = int(M1['m10'] / M1['m00'])
                cY = int(M1['m01'] / M1['m00'])
                # 在中心點畫上黃色實心圓
                cv2.circle(frame1, (cX, cY), 5, (1, 227, 254), -1)
                
                #找到一个直矩形(不会旋转)
                x,y,w,h1 = cv2.boundingRect(c)
                #画出这个矩形
                cv2.rectangle(frame1,(x,y),(x+w,y+h1),(0,255,0),2)
                
                # 用红色表示有旋转角度的矩形框架
                rect = cv2.minAreaRect(c)
                box = cv2.boxPoints(rect)
                box = np.int0(box)
                cv2.drawContours(frame1, [box], 0, (0, 0, 255), 2)
                #cv2.imwrite('contours.png', frame)               
                #单目测距
                d1=0.01*h1/1.8
                
                    
        grid=np.zeros((30,45))
        c1=[0,0,0]#相机位置
        for i in range(30):
            for j in range(45):
                if (np.linalg.norm(np.array([i,j,1.8])-np.array(c1))<1.1*d1 and
                    np.linalg.norm(np.array([i,j,1.8])-np.array(c1))>0.9*d1):
                    grid[i,j]=np.linalg.norm(np.array([i,j,1.8])-np.array(c1))
                # if (np.linalg.norm(np.array([i,j,1.8])-np.array(c2))<1.1*d2 and
                #     np.linalg.norm(np.array([i,j,1.8])-np.array(c2))>0.9*d2):
                #     grid[i,j]=np.linalg.norm(np.array([i,j,1.8])-np.array(c2))
                # if (np.linalg.norm(np.array([i,j,1.8])-np.array(c3))<1.1*d3 and
                #     np.linalg.norm(np.array([i,j,1.8])-np.array(c3))>0.9*d3):
                #     grid[i,j]=np.linalg.norm(np.array([i,j,1.8])-np.array(c3))
                # if (np.linalg.norm(np.array([i,j,1.8])-np.array(c4))<1.1*d4 and
                #     np.linalg.norm(np.array([i,j,1.8])-np.array(c4))>0.9*d4):
                #     grid[i,j]=np.linalg.norm(np.array([i,j,1.8])-np.array(c4))
        
#        xdata1=max(grid)
#        ydata1=max(grid)

        out.write(fgmask1)
        cv2.imshow('frame1',frame1)
        cv2.imshow('fgmask1',fgmask1)
    
    else:
        break

    if cv2.waitKey(25) & 0xFF == ord('q'):
        break
    
out.release()
cap1.release()
cv2.destroyAllWindows()

 

root@autodl-container-8bf9409db0-3243e00c:~/autodl-tmp# python utils_one.py /root/autodl-tmp/utils_one.py:134: SyntaxWarning: invalid escape sequence '\_' """ 设备信息: { "device": "cuda", "gpu_available": true, "gpu_name": "NVIDIA H20", "total_memory": "102.11 GB", "used_memory": "0.47 GB" } 开始对话评估... 测试 1/5434 - 得分: 0.2356 - ✗ 测试 2/5434 - 得分: 0.2356 - ✗ 测试 3/5434 - 得分: 0.2356 - ✗ 测试 4/5434 - 得分: 0.2356 - ✗ 测试 5/5434 - 得分: 0.2356 - ✗ 测试 6/5434 - 得分: 0.2356 - ✗ 测试 7/5434 - 得分: 0.2356 - ✗ 测试 8/5434 - 得分: 0.2356 - ✗ 测试 9/5434 - 得分: 0.2356 - ✗ 测试 10/5434 - 得分: 0.2356 - ✗ 测试 11/5434 - 得分: 0.2356 - ✗ 测试 12/5434 - 得分: 0.2356 - ✗ 测试 13/5434 - 得分: 0.2356 - ✗ 测试 14/5434 - 得分: 0.2356 - ✗ 测试 15/5434 - 得分: 0.2356 - ✗ 测试 16/5434 - 得分: 0.2356 - ✗ 测试 17/5434 - 得分: 0.2356 - ✗ 测试 18/5434 - 得分: 0.2356 - ✗ 测试 19/5434 - 得分: 0.2356 - ✗ 测试 20/5434 - 得分: 0.2356 - ✗ 测试 21/5434 - 得分: 0.2356 - ✗ 测试 22/5434 - 得分: 0.2356 - ✗ 测试 23/5434 - 得分: 0.2356 - ✗ 测试 24/5434 - 得分: 0.2356 - ✗ 测试 25/5434 - 得分: 0.2356 - ✗ 测试 26/5434 - 得分: 0.2356 - ✗ 测试 27/5434 - 得分: 0.2356 - ✗ 测试 28/5434 - 得分: 0.2356 - ✗ 测试 29/5434 - 得分: 0.2356 - ✗ 测试 30/5434 - 得分: 0.2356 - ✗ 测试 31/5434 - 得分: 0.2356 - ✗ 测试 32/5434 - 得分: 0.2356 - ✗ 测试 33/5434 - 得分: 0.2356 - ✗ 测试 34/5434 - 得分: 0.2356 - ✗ 测试 35/5434 - 得分: 0.2356 - ✗ 测试 36/5434 - 得分: 0.2356 - ✗ 测试 37/5434 - 得分: 0.2356 - ✗ 测试 38/5434 - 得分: 0.2356 - ✗ 测试 39/5434 - 得分: 0.2356 - ✗ 测试 40/5434 - 得分: 0.2356 - ✗ 测试 41/5434 - 得分: 0.2356 - ✗ 测试 42/5434 - 得分: 0.2356 - ✗ 测试 43/5434 - 得分: 0.2356 - ✗ 测试 44/5434 - 得分: 0.2356 - ✗ 测试 45/5434 - 得分: 0.2356 - ✗ 测试 46/5434 - 得分: 0.2356 - ✗ 测试 47/5434 - 得分: 0.2356 - ✗ 测试 48/5434 - 得分: 0.2356 - ✗ 测试 49/5434 - 得分: 0.2356 - ✗ 测试 50/5434 - 得分: 0.2356 - ✗ 测试 51/5434 - 得分: 0.2356 - ✗ 测试 52/5434 - 得分: 0.2356 - ✗ 测试 53/5434 - 得分: 0.2356 - ✗ 测试 54/5434 - 得分: 0.2356 - ✗ 测试 55/5434 - 得分: 0.2356 - ✗ 测试 56/5434 - 得分: 0.2356 - ✗ 测试 57/5434 - 得分: 0.2356 - ✗ 测试 58/5434 - 得分: 0.2356 - ✗ 测试 59/5434 - 得分: 0.2356 - ✗ 测试 60/5434 - 得分: 0.2356 - ✗ 测试 61/5434 - 得分: 0.2356 - ✗ 测试 62/5434 - 得分: 0.2356 - ✗ 测试 63/5434 - 得分: 0.2356 - ✗ 测试 64/5434 - 得分: 0.2356 - ✗ 测试 65/5434 - 得分: 0.2356 - ✗ 测试 66/5434 - 得分: 0.2356 - ✗ 测试 67/5434 - 得分: 0.2356 - ✗ 测试 68/5434 - 得分: 0.2356 - ✗ 测试 69/5434 - 得分: 0.2356 - ✗ 测试 70/5434 - 得分: 0.2356 - ✗ 测试 71/5434 - 得分: 0.2356 - ✗ 测试 72/5434 - 得分: 0.2356 - ✗ 测试 73/5434 - 得分: 0.2356 - ✗ 测试 74/5434 - 得分: 0.2356 - ✗ 测试 75/5434 - 得分: 0.2356 - ✗ 测试 76/5434 - 得分: 0.2356 - ✗ 测试 77/5434 - 得分: 0.2356 - ✗ 测试 78/5434 - 得分: 0.2356 - ✗ 测试 79/5434 - 得分: 0.2356 - ✗ 测试 80/5434 - 得分: 0.2356 - ✗ 测试 81/5434 - 得分: 0.2356 - ✗ 测试 82/5434 - 得分: 0.2356 - ✗ 测试 83/5434 - 得分: 0.2356 - ✗ 测试 84/5434 - 得分: 0.2356 - ✗ 测试 85/5434 - 得分: 0.2356 - ✗ 测试 86/5434 - 得分: 0.2356 - ✗ 测试 87/5434 - 得分: 0.2356 - ✗ 测试 88/5434 - 得分: 0.2356 - ✗ 测试 89/5434 - 得分: 0.2356 - ✗ 测试 90/5434 - 得分: 0.2356 - ✗ 测试 91/5434 - 得分: 0.2356 - ✗ 测试 92/5434 - 得分: 0.2356 - ✗ 测试 93/5434 - 得分: 0.2356 - ✗ 测试 94/5434 - 得分: 0.2356 - ✗ 测试 95/5434 - 得分: 0.2356 - ✗ 测试 96/5434 - 得分: 0.2356 - ✗ 测试 97/5434 - 得分: 0.2356 - ✗ 测试 98/5434 - 得分: 0.2356 - ✗ 测试 99/5434 - 得分: 0.2356 - ✗ 测试 100/5434 - 得分: 0.2356 - ✗ 测试 101/5434 - 得分: 0.2356 - ✗ 测试 102/5434 - 得分: 0.2356 - ✗ 测试 103/5434 - 得分: 0.2356 - ✗ 测试 104/5434 - 得分: 0.2356 - ✗ 测试 105/5434 - 得分: 0.2356 - ✗ 测试 106/5434 - 得分: 0.2356 - ✗ 测试 107/5434 - 得分: 0.2356 - ✗ 测试 108/5434 - 得分: 0.2356 - ✗ 测试 109/5434 - 得分: 0.2356 - ✗ 测试 110/5434 - 得分: 0.2356 - ✗ ^C测试 111/5434 - 得分: 0.2356 - ✗ Traceback (most recent call last): File "/root/autodl-tmp/utils_one.py", line 201, in <module> summary = evaluator.evaluate(output_path="dialogue_results.json") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/autodl-tmp/utils_one.py", line 172, in evaluate print(f"测试 {i+1}/{len(dialogues)} - 得分: {result.similarity_score:.4f} - {'✓' if result.is_correct else '✗'}")
06-05
2025-06-22 18:56:53.192710: I tensorflow/core/util/port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`. 2025-06-22 18:56:54.136866: I tensorflow/core/util/port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`. 2025-06-22 18:56:56,467 - INFO - 加载并增强数据集: augmented_data 2025-06-22 18:56:56,560 - INFO - 原始数据集: 150 张图片, 5 个类别 2025-06-22 18:56:56,565 - INFO - 类别 book: 30 张原始图像 2025-06-22 18:56:56,989 - INFO - 类别 cup: 30 张原始图像 2025-06-22 18:56:57,403 - INFO - 类别 glasses: 30 张原始图像 2025-06-22 18:56:57,820 - INFO - 类别 phone: 30 张原始图像 2025-06-22 18:56:58,248 - INFO - 类别 shoe: 30 张原始图像 2025-06-22 18:56:58,859 - INFO - 增强后数据集: 450 张图片 2025-06-22 18:56:58,954 - INFO - 构建优化的迁移学习模型... 2025-06-22 18:56:58.959007: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations. To enable the following instructions: SSE3 SSE4.1 SSE4.2 AVX AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags. Model: "functional" ┌─────────────────────┬───────────────────┬────────────┬───────────────────┐ │ Layer (type)Output Shape │ Param # │ Connected to │ ├─────────────────────┼───────────────────┼────────────┼───────────────────┤ │ input_layer_1(None, 224, 224, │ 0 │ - │ │ (InputLayer) │ 3) │ │ │ ├─────────────────────┼───────────────────┼────────────┼───────────────────┤ │ efficientnetb0 │ (None, 7, 7, │ 4,049,571 │ input_layer_1[0]… │ │ (Functional)1280) │ │ │ ├─────────────────────┼───────────────────┼────────────┼───────────────────┤ │ global_average_poo… │ (None, 1280) │ 0 │ efficientnetb0[0… │ │ (GlobalAveragePool… │ │ │ │ ├─────────────────────┼───────────────────┼────────────┼───────────────────┤ │ dense (Dense)(None, 512) │ 655,872 │ global_average_p… │ ├─────────────────────┼───────────────────┼────────────┼───────────────────┤ │ dense_1 (Dense)(None, 1280) │ 656,640 │ dense[0][0] │ ├─────────────────────┼───────────────────┼────────────┼───────────────────┤ │ multiply (Multiply)(None, 1280) │ 0 │ global_average_p… │ │ │ │ │ dense_1[0][0] │ ├─────────────────────┼───────────────────┼────────────┼───────────────────┤ │ dense_2 (Dense)(None, 512) │ 655,872 │ multiply[0][0] │ ├─────────────────────┼───────────────────┼────────────┼───────────────────┤ │ batch_normalization │ (None, 512) │ 2,048 │ dense_2[0][0] │ │ (BatchNormalizatio… │ │ │ │ ├─────────────────────┼───────────────────┼────────────┼───────────────────┤ │ dropout (Dropout)(None, 512) │ 0 │ batch_normalizat… │ ├─────────────────────┼───────────────────┼────────────┼───────────────────┤ │ dense_3 (Dense)(None, 5) │ 2,565 │ dropout[0][0] │ └─────────────────────┴───────────────────┴────────────┴───────────────────┘ Total params: 6,022,568 (22.97 MB) Trainable params: 1,971,973 (7.52 MB) Non-trainable params: 4,050,595 (15.45 MB) 2025-06-22 18:56:59,882 - INFO - 开始高级训练策略... 2025-06-22 18:56:59,882 - INFO - 阶段1: 冻结基础模型训练 Epoch 1/50 23/23 ━━━━━━━━━━━━━━━━━━━━ 16s 442ms/step - accuracy: 0.2001 - loss: 1.7270 - val_accuracy: 0.2000 - val_loss: 1.6104 - learning_rate: 1.0000e-04 Epoch 2/50 23/23 ━━━━━━━━━━━━━━━━━━━━ 8s 335ms/step - accuracy: 0.1486 - loss: 1.7114 - val_accuracy: 0.2000 - val_loss: 1.6100 - learning_rate: 1.0000e-04 Epoch 3/50 23/23 ━━━━━━━━━━━━━━━━━━━━ 8s 332ms/step - accuracy: 0.2337 - loss: 1.7239 - val_accuracy: 0.2000 - val_loss: 1.6117 - learning_rate: 1.0000e-04 Epoch 4/50 23/23 ━━━━━━━━━━━━━━━━━━━━ 8s 335ms/step - accuracy: 0.2558 - loss: 1.6466 - val_accuracy: 0.2000 - val_loss: 1.6104 - learning_rate: 1.0000e-04 Epoch 5/50 23/23 ━━━━━━━━━━━━━━━━━━━━ 0s 270ms/step - accuracy: 0.2281 - loss: 1.6503 Epoch 5: ReduceLROnPlateau reducing learning rate to 4.999999873689376e-05. 23/23 ━━━━━━━━━━━━━━━━━━━━ 8s 367ms/step - accuracy: 0.2271 - loss: 1.6513 - val_accuracy: 0.2111 - val_loss: 1.6118 - learning_rate: 1.0000e-04 Epoch 6/50 23/23 ━━━━━━━━━━━━━━━━━━━━ 8s 333ms/step - accuracy: 0.1899 - loss: 1.6756 - val_accuracy: 0.2000 - val_loss: 1.6112 - learning_rate: 5.0000e-05 Epoch 7/50 23/23 ━━━━━━━━━━━━━━━━━━━━ 8s 333ms/step - accuracy: 0.2394 - loss: 1.6269 - val_accuracy: 0.2000 - val_loss: 1.6128 - learning_rate: 5.0000e-05 Epoch 8/50 23/23 ━━━━━━━━━━━━━━━━━━━━ 0s 266ms/step - accuracy: 0.2041 - loss: 1.7332 Epoch 8: ReduceLROnPlateau reducing learning rate to 2.499999936844688e-05. 23/23 ━━━━━━━━━━━━━━━━━━━━ 8s 333ms/step - accuracy: 0.2042 - loss: 1.7319 - val_accuracy: 0.2000 - val_loss: 1.6103 - learning_rate: 5.0000e-05 Epoch 9/50 23/23 ━━━━━━━━━━━━━━━━━━━━ 8s 355ms/step - accuracy: 0.1765 - loss: 1.6814 - val_accuracy: 0.3333 - val_loss: 1.6107 - learning_rate: 2.5000e-05 2025-06-22 18:58:18,867 - INFO - 阶段2: 微调部分层 Epoch 1/25 23/23 ━━━━━━━━━━━━━━━━━━━━ 18s 460ms/step - accuracy: 0.2374 - loss: 2.4082 - val_accuracy: 0.2000 - val_loss: 1.6107 - learning_rate: 1.0000e-05 Epoch 2/25 23/23 ━━━━━━━━━━━━━━━━━━━━ 9s 390ms/step - accuracy: 0.2021 - loss: 2.2585 - val_accuracy: 0.2000 - val_loss: 1.6112 - learning_rate: 1.0000e-05 Epoch 3/25 23/23 ━━━━━━━━━━━━━━━━━━━━ 9s 375ms/step - accuracy: 0.2259 - loss: 2.3548 - val_accuracy: 0.2111 - val_loss: 1.6121 - learning_rate: 1.0000e-05 Epoch 4/25 23/23 ━━━━━━━━━━━━━━━━━━━━ 0s 307ms/step - accuracy: 0.2416 - loss: 2.0942 Epoch 4: ReduceLROnPlateau reducing learning rate to 4.999999873689376e-06. 23/23 ━━━━━━━━━━━━━━━━━━━━ 9s 374ms/step - accuracy: 0.2405 - loss: 2.1006 - val_accuracy: 0.2000 - val_loss: 1.6127 - learning_rate: 1.0000e-05 Epoch 5/25 23/23 ━━━━━━━━━━━━━━━━━━━━ 9s 377ms/step - accuracy: 0.2053 - loss: 2.1248 - val_accuracy: 0.2000 - val_loss: 1.6136 - learning_rate: 5.0000e-06 Epoch 6/25 23/23 ━━━━━━━━━━━━━━━━━━━━ 9s 382ms/step - accuracy: 0.1995 - loss: 2.2549 - val_accuracy: 0.2000 - val_loss: 1.6150 - learning_rate: 5.0000e-06 Epoch 7/25 23/23 ━━━━━━━━━━━━━━━━━━━━ 0s 305ms/step - accuracy: 0.1949 - loss: 2.1615 Epoch 7: ReduceLROnPlateau reducing learning rate to 2.499999936844688e-06. 23/23 ━━━━━━━━━━━━━━━━━━━━ 9s 373ms/step - accuracy: 0.1962 - loss: 2.1615 - val_accuracy: 0.2000 - val_loss: 1.6165 - learning_rate: 5.0000e-06 Epoch 8/25 23/23 ━━━━━━━━━━━━━━━━━━━━ 9s 375ms/step - accuracy: 0.2320 - loss: 2.1199 - val_accuracy: 0.2000 - val_loss: 1.6186 - learning_rate: 2.5000e-06 Epoch 9/25 23/23 ━━━━━━━━━━━━━━━━━━━━ 9s 378ms/step - accuracy: 0.2379 - loss: 2.1694 - val_accuracy: 0.2000 - val_loss: 1.6204 - learning_rate: 2.5000e-06 2025-06-22 18:59:46,920 - INFO - 训练完成 2025-06-22 18:59:46,920 - INFO - 评估模型... 2025-06-22 18:59:48,600 - INFO - 测试准确率: 20.00% E:\pycharm\study\计算机视觉\物品识别系统.py:313: UserWarning: Glyph 20934 (\N{CJK UNIFIED IDEOGRAPH-51C6}) missing from font(s) DejaVu Sans. plt.tight_layout() E:\pycharm\study\计算机视觉\物品识别系统.py:313: UserWarning: Glyph 30830 (\N{CJK UNIFIED IDEOGRAPH-786E}) missing from font(s) DejaVu Sans. plt.tight_layout() E:\pycharm\study\计算机视觉\物品识别系统.py:313: UserWarning: Glyph 29575 (\N{CJK UNIFIED IDEOGRAPH-7387}) missing from font(s) DejaVu Sans. plt.tight_layout() E:\pycharm\study\计算机视觉\物品识别系统.py:313: UserWarning: Glyph 35757 (\N{CJK UNIFIED IDEOGRAPH-8BAD}) missing from font(s) DejaVu Sans. plt.tight_layout() E:\pycharm\study\计算机视觉\物品识别系统.py:313: UserWarning: Glyph 32451 (\N{CJK UNIFIED IDEOGRAPH-7EC3}) missing from font(s) DejaVu Sans. plt.tight_layout() E:\pycharm\study\计算机视觉\物品识别系统.py:313: UserWarning: Glyph 21644 (\N{CJK UNIFIED IDEOGRAPH-548C}) missing from font(s) DejaVu Sans. plt.tight_layout() E:\pycharm\study\计算机视觉\物品识别系统.py:313: UserWarning: Glyph 39564 (\N{CJK UNIFIED IDEOGRAPH-9A8C}) missing from font(s) DejaVu Sans. plt.tight_layout() E:\pycharm\study\计算机视觉\物品识别系统.py:313: UserWarning: Glyph 35777 (\N{CJK UNIFIED IDEOGRAPH-8BC1}) missing from font(s) DejaVu Sans. plt.tight_layout() E:\pycharm\study\计算机视觉\物品识别系统.py:313: UserWarning: Glyph 25439 (\N{CJK UNIFIED IDEOGRAPH-635F}) missing from font(s) DejaVu Sans. plt.tight_layout() E:\pycharm\study\计算机视觉\物品识别系统.py:313: UserWarning: Glyph 22833 (\N{CJK UNIFIED IDEOGRAPH-5931}) missing from font(s) DejaVu Sans. plt.tight_layout() E:\pycharm\study\计算机视觉\物品识别系统.py:314: UserWarning: Glyph 20934 (\N{CJK UNIFIED IDEOGRAPH-51C6}) missing from font(s) DejaVu Sans. plt.savefig('training_history.png') E:\pycharm\study\计算机视觉\物品识别系统.py:314: UserWarning: Glyph 30830 (\N{CJK UNIFIED IDEOGRAPH-786E}) missing from font(s) DejaVu Sans. plt.savefig('training_history.png') E:\pycharm\study\计算机视觉\物品识别系统.py:314: UserWarning: Glyph 29575 (\N{CJK UNIFIED IDEOGRAPH-7387}) missing from font(s) DejaVu Sans. plt.savefig('training_history.png') E:\pycharm\study\计算机视觉\物品识别系统.py:314: UserWarning: Glyph 35757 (\N{CJK UNIFIED IDEOGRAPH-8BAD}) missing from font(s) DejaVu Sans. plt.savefig('training_history.png') E:\pycharm\study\计算机视觉\物品识别系统.py:314: UserWarning: Glyph 32451 (\N{CJK UNIFIED IDEOGRAPH-7EC3}) missing from font(s) DejaVu Sans. plt.savefig('training_history.png') E:\pycharm\study\计算机视觉\物品识别系统.py:314: UserWarning: Glyph 21644 (\N{CJK UNIFIED IDEOGRAPH-548C}) missing from font(s) DejaVu Sans. plt.savefig('training_history.png') E:\pycharm\study\计算机视觉\物品识别系统.py:314: UserWarning: Glyph 39564 (\N{CJK UNIFIED IDEOGRAPH-9A8C}) missing from font(s) DejaVu Sans. plt.savefig('training_history.png') E:\pycharm\study\计算机视觉\物品识别系统.py:314: UserWarning: Glyph 35777 (\N{CJK UNIFIED IDEOGRAPH-8BC1}) missing from font(s) DejaVu Sans. plt.savefig('training_history.png') E:\pycharm\study\计算机视觉\物品识别系统.py:314: UserWarning: Glyph 25439 (\N{CJK UNIFIED IDEOGRAPH-635F}) missing from font(s) DejaVu Sans. plt.savefig('training_history.png') E:\pycharm\study\计算机视觉\物品识别系统.py:314: UserWarning: Glyph 22833 (\N{CJK UNIFIED IDEOGRAPH-5931}) missing from font(s) DejaVu Sans. plt.savefig('training_history.png') 2025-06-22 18:59:48,905 - INFO - 训练历史图表已保存到 training_history.png 2025-06-22 18:59:49,390 - INFO - 模型已保存到: optimized_model.keras 2025-06-22 18:59:49,390 - INFO - 执行内存清理... WARNING:tensorflow:From E:\python3.9.13\lib\site-packages\keras\src\backend\common\global_state.py:82: The name tf.reset_default_graph is deprecated. Please use tf.compat.v1.reset_default_graph instead. 2025-06-22 18:59:50,195 - WARNING - From E:\python3.9.13\lib\site-packages\keras\src\backend\common\global_state.py:82: The name tf.reset_default_graph is deprecated. Please use tf.compat.v1.reset_default_graph instead. 2025-06-22 18:59:50,743 - INFO - 内存清理完成 E:\pycharm\study\计算机视觉\物品识别系统.py:355: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator. ax2.set_xticklabels(self.class_labels, rotation=45) E:\pycharm\study\计算机视觉\物品识别系统.py:364: UserWarning: Glyph 39044 (\N{CJK UNIFIED IDEOGRAPH-9884}) missing from font(s) DejaVu Sans. plt.tight_layout() E:\pycharm\study\计算机视觉\物品识别系统.py:364: UserWarning: Glyph 27979 (\N{CJK UNIFIED IDEOGRAPH-6D4B}) missing from font(s) DejaVu Sans. plt.tight_layout() E:\pycharm\study\计算机视觉\物品识别系统.py:364: UserWarning: Glyph 27010 (\N{CJK UNIFIED IDEOGRAPH-6982}) missing from font(s) DejaVu Sans. plt.tight_layout() E:\pycharm\study\计算机视觉\物品识别系统.py:364: UserWarning: Glyph 29575 (\N{CJK UNIFIED IDEOGRAPH-7387}) missing from font(s) DejaVu Sans. plt.tight_layout() E:\pycharm\study\计算机视觉\物品识别系统.py:364: UserWarning: Glyph 31867 (\N{CJK UNIFIED IDEOGRAPH-7C7B}) missing from font(s) DejaVu Sans. plt.tight_layout() E:\pycharm\study\计算机视觉\物品识别系统.py:364: UserWarning: Glyph 21035 (\N{CJK UNIFIED IDEOGRAPH-522B}) missing from font(s) DejaVu Sans. plt.tight_layout() E:\pycharm\study\计算机视觉\物品识别系统.py:364: UserWarning: Glyph 20998 (\N{CJK UNIFIED IDEOGRAPH-5206}) missing from font(s) DejaVu Sans. plt.tight_layout() E:\pycharm\study\计算机视觉\物品识别系统.py:364: UserWarning: Glyph 24067 (\N{CJK UNIFIED IDEOGRAPH-5E03}) missing from font(s) DejaVu Sans. plt.tight_layout() E:\pycharm\study\计算机视觉\物品识别系统.py:365: UserWarning: Glyph 39044 (\N{CJK UNIFIED IDEOGRAPH-9884}) missing from font(s) DejaVu Sans. plt.savefig(output_path) E:\pycharm\study\计算机视觉\物品识别系统.py:365: UserWarning: Glyph 27979 (\N{CJK UNIFIED IDEOGRAPH-6D4B}) missing from font(s) DejaVu Sans. plt.savefig(output_path) E:\pycharm\study\计算机视觉\物品识别系统.py:365: UserWarning: Glyph 27010 (\N{CJK UNIFIED IDEOGRAPH-6982}) missing from font(s) DejaVu Sans. plt.savefig(output_path) E:\pycharm\study\计算机视觉\物品识别系统.py:365: UserWarning: Glyph 29575 (\N{CJK UNIFIED IDEOGRAPH-7387}) missing from font(s) DejaVu Sans. plt.savefig(output_path) E:\pycharm\study\计算机视觉\物品识别系统.py:365: UserWarning: Glyph 31867 (\N{CJK UNIFIED IDEOGRAPH-7C7B}) missing from font(s) DejaVu Sans. plt.savefig(output_path) E:\pycharm\study\计算机视觉\物品识别系统.py:365: UserWarning: Glyph 21035 (\N{CJK UNIFIED IDEOGRAPH-522B}) missing from font(s) DejaVu Sans. plt.savefig(output_path) E:\pycharm\study\计算机视觉\物品识别系统.py:365: UserWarning: Glyph 20998 (\N{CJK UNIFIED IDEOGRAPH-5206}) missing from font(s) DejaVu Sans. plt.savefig(output_path) E:\pycharm\study\计算机视觉\物品识别系统.py:365: UserWarning: Glyph 24067 (\N{CJK UNIFIED IDEOGRAPH-5E03}) missing from font(s) DejaVu Sans. plt.savefig(output_path) 2025-06-22 18:59:52,251 - INFO - 预测结果已保存到 prediction_result.png 2025-06-22 18:59:52,252 - INFO - 真实类别: cup
06-23
# ComfyUI Error Report ## Error Details - **Node ID:** 90 - **Node Type:** WanVideoSampler - **Exception Type:** UnboundLocalError - **Exception Message:** cannot access local variable 'callback_latent' where it is not associated with a value ## Stack Trace ``` File "G:\comfyui\ComfyUI\execution.py", line 496, in execute output_data, output_ui, has_subgraph, has_pending_tasks = await get_output_data(prompt_id, unique_id, obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, hidden_inputs=hidden_inputs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "G:\comfyui\ComfyUI\execution.py", line 315, in get_output_data return_values = await _async_map_node_over_list(prompt_id, unique_id, obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, hidden_inputs=hidden_inputs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "G:\comfyui\ComfyUI\execution.py", line 289, in _async_map_node_over_list await process_inputs(input_dict, i) File "G:\comfyui\ComfyUI\execution.py", line 277, in process_inputs result = f(**inputs) ^^^^^^^^^^^ File "G:\comfyui\ComfyUI\custom_nodes\ComfyUI-WanVideoWrapper\nodes.py", line 3988, in process "samples": callback_latent.unsqueeze(0).cpu() if callback is not None else None, ^^^^^^^^^^^^^^^ ``` ## System Information - **ComfyUI Version:** 0.3.56 - **Arguments:** main.py --auto-launch - **OS:** nt - **Python Version:** 3.12.10 (tags/v3.12.10:0cc8128, Apr 8 2025, 12:21:36) [MSC v.1943 64 bit (AMD64)] - **Embedded Python:** false - **PyTorch Version:** 2.7.1+cu128 ## Devices - **Name:** cuda:0 NVIDIA GeForce RTX 4070 Ti SUPER : cudaMallocAsync - **Type:** cuda - **VRAM Total:** 17170956288 - **VRAM Free:** 15821963264 - **Torch VRAM Total:** 0 - **Torch VRAM Free:** 0 ## Logs ``` 2025-09-01T14:58:56.860057 - 0.9 seconds: G:\comfyui\ComfyUI\custom_nodes\comfyui-mixlab-nodes 2025-09-01T14:58:56.860057 - 1.1 seconds: G:\comfyui\ComfyUI\custom_nodes\ComfyUI_Custom_Nodes_AlekPet 2025-09-01T14:58:56.861054 - 1.7 seconds: G:\comfyui\ComfyUI\custom_nodes\ComfyUI-nunchaku 2025-09-01T14:58:56.861054 - 2.4 seconds: G:\comfyui\ComfyUI\custom_nodes\ComfyUI-Easy-Use 2025-09-01T14:58:56.861054 - 2025-09-01T14:58:57.088527 - Context impl SQLiteImpl. 2025-09-01T14:58:57.088527 - Will assume non-transactional DDL. 2025-09-01T14:58:57.089524 - No target revision found. 2025-09-01T14:58:57.111451 - Starting server 2025-09-01T14:58:57.112447 - To see the GUI go to: http://127.0.0.1:8188 2025-09-01T14:58:58.110145 - G:\comfyui\ComfyUI\custom_nodes\comfyui-mixlab-nodes\webApp\lib/photoswipe-lightbox.esm.min.js2025-09-01T14:58:58.110145 - 2025-09-01T14:58:58.154639 - G:\comfyui\ComfyUI\custom_nodes\comfyui-mixlab-nodes\webApp\lib/photoswipe.min.css2025-09-01T14:58:58.154639 - 2025-09-01T14:58:58.155636 - G:\comfyui\ComfyUI\custom_nodes\comfyui-mixlab-nodes\webApp\lib/pickr.min.js2025-09-01T14:58:58.155636 - 2025-09-01T14:58:58.192513 - G:\comfyui\ComfyUI\custom_nodes\comfyui-mixlab-nodes\webApp\lib/classic.min.css2025-09-01T14:58:58.192513 - 2025-09-01T14:58:58.193509 - G:\comfyui\ComfyUI\custom_nodes\comfyui-mixlab-nodes\webApp\lib/model-viewer.min.js2025-09-01T14:58:58.193509 - 2025-09-01T14:58:58.197497 - G:\comfyui\ComfyUI\custom_nodes\comfyui-mixlab-nodes\webApp\lib/juxtapose.css2025-09-01T14:58:58.198493 - 2025-09-01T14:58:58.209456 - G:\comfyui\ComfyUI\custom_nodes\comfyui-mixlab-nodes\webApp\lib/juxtapose.min.js2025-09-01T14:58:58.209456 - 2025-09-01T14:58:58.799579 - [G:\comfyui\ComfyUI\custom_nodes\comfy_mtb] | INFO -> Found multiple match, we will pick the last D:\AI-sd\sd-webui-aki-v4\models\SwinIR ['G:\\comfyui\\ComfyUI\\models\\upscale_models', 'D:\\AI-sd\\sd-webui-aki-v4\\models\\ESRGAN', 'D:\\AI-sd\\sd-webui-aki-v4\\models\\RealESRGAN', 'D:\\AI-sd\\sd-webui-aki-v4\\models\\SwinIR'] 2025-09-01T14:58:58.807556 - []2025-09-01T14:58:58.807556 - 2025-09-01T14:58:58.807556 - []2025-09-01T14:58:58.807556 - 2025-09-01T14:59:00.532965 - got prompt 2025-09-01T14:59:00.569842 - Using xformers attention in VAE 2025-09-01T14:59:00.570844 - Using xformers attention in VAE 2025-09-01T14:59:00.726582 - VAE load device: cuda:0, offload device: cpu, dtype: torch.bfloat16 2025-09-01T14:59:00.882662 - Requested to load FluxClipModel_ 2025-09-01T14:59:00.889639 - loaded completely 9.5367431640625e+25 4777.53759765625 True 2025-09-01T14:59:00.998583 - CLIP/text encoder model load device: cuda:0, offload device: cpu, current: cuda:0, dtype: torch.float16 2025-09-01T14:59:01.063367 - clip missing: ['text_projection.weight'] 2025-09-01T14:59:01.722971 - FETCH ComfyRegistry Data: 5/962025-09-01T14:59:01.722971 - 2025-09-01T14:59:03.042519 - model weight dtype torch.float8_e4m3fn, manual cast: torch.bfloat16 2025-09-01T14:59:03.043516 - model_type FLUX 2025-09-01T14:59:11.471386 - FETCH ComfyRegistry Data: 10/962025-09-01T14:59:11.473376 - 2025-09-01T14:59:11.998346 - Requested to load Flux 2025-09-01T14:59:18.503848 - loaded completely 0.0 11350.067443847656 True 2025-09-01T14:59:18.514805 - Patching comfy attention to use sageattn2025-09-01T14:59:18.514805 - 2025-09-01T14:59:18.688225 - 0%| | 0/20 [00:00<?, ?it/s]2025-09-01T14:59:20.150041 - FETCH ComfyRegistry Data: 15/962025-09-01T14:59:20.150041 - 2025-09-01T14:59:28.628200 - 40%|█████████████████████████████████▏ | 8/20 [00:09<00:14, 1.17s/it]2025-09-01T14:59:29.656666 - FETCH ComfyRegistry Data: 20/962025-09-01T14:59:29.657170 - 2025-09-01T14:59:37.969589 - 80%|█████████████████████████████████████████████████████████████████▌ | 16/20 [00:19<00:04, 1.16s/it]2025-09-01T14:59:38.276116 - FETCH ComfyRegistry Data: 25/962025-09-01T14:59:38.276619 - 2025-09-01T14:59:42.606388 - 100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:23<00:00, 1.16s/it]2025-09-01T14:59:42.609378 - 100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:23<00:00, 1.20s/it]2025-09-01T14:59:42.610375 - 2025-09-01T14:59:42.612369 - Restoring initial comfy attention2025-09-01T14:59:42.613364 - 2025-09-01T14:59:43.566091 - Requested to load AutoencodingEngine 2025-09-01T14:59:44.164328 - loaded completely 0.0 159.87335777282715 True 2025-09-01T14:59:44.683600 - comfyui lumi batcher overwrite task done2025-09-01T14:59:44.684596 - 2025-09-01T14:59:44.695560 - Prompt executed in 44.16 seconds 2025-09-01T14:59:47.355547 - FETCH ComfyRegistry Data: 30/962025-09-01T14:59:47.355547 - 2025-09-01T14:59:50.013416 - got prompt 2025-09-01T14:59:50.431031 - loaded completely 0.0 11350.067443847656 True 2025-09-01T14:59:50.435018 - Patching comfy attention to use sageattn2025-09-01T14:59:50.435018 - 2025-09-01T14:59:55.538670 - 25%|████████████████████▊ | 5/20 [00:05<00:16, 1.11s/it]2025-09-01T14:59:56.060186 - FETCH ComfyRegistry Data: 35/962025-09-01T14:59:56.060689 - 2025-09-01T15:00:03.927199 - 60%|█████████████████████████████████████████████████▏ | 12/20 [00:13<00:09, 1.19s/it]2025-09-01T15:00:04.665127 - FETCH ComfyRegistry Data: 40/962025-09-01T15:00:04.666123 - 2025-09-01T15:00:13.251827 - 100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:22<00:00, 1.14s/it]2025-09-01T15:00:13.252823 - 100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:22<00:00, 1.14s/it]2025-09-01T15:00:13.252823 - 2025-09-01T15:00:13.253821 - Restoring initial comfy attention2025-09-01T15:00:13.253821 - 2025-09-01T15:00:13.397095 - FETCH ComfyRegistry Data: 45/962025-09-01T15:00:13.397604 - 2025-09-01T15:00:14.837381 - loaded completely 0.0 159.87335777282715 True 2025-09-01T15:00:15.176809 - comfyui lumi batcher overwrite task done2025-09-01T15:00:15.177805 - 2025-09-01T15:00:15.179799 - Prompt executed in 25.16 seconds 2025-09-01T15:00:22.087367 - FETCH ComfyRegistry Data: 50/962025-09-01T15:00:22.088368 - 2025-09-01T15:00:26.342724 - got prompt 2025-09-01T15:00:27.137497 - loaded completely 0.0 11350.067443847656 True 2025-09-01T15:00:27.148464 - Patching comfy attention to use sageattn2025-09-01T15:00:27.148464 - 2025-09-01T15:00:29.963897 - 15%|████████████▍ | 3/20 [00:02<00:17, 1.03s/it]2025-09-01T15:00:30.838878 - FETCH ComfyRegistry Data: 55/962025-09-01T15:00:30.839380 - 2025-09-01T15:00:39.316242 - 55%|█████████████████████████████████████████████ | 11/20 [00:12<00:10, 1.17s/it]2025-09-01T15:00:39.731658 - FETCH ComfyRegistry Data: 60/962025-09-01T15:00:39.737147 - 2025-09-01T15:00:47.708181 - 90%|█████████████████████████████████████████████████████████████████████████▊ | 18/20 [00:20<00:02, 1.20s/it]2025-09-01T15:00:48.592029 - FETCH ComfyRegistry Data: 65/962025-09-01T15:00:48.592029 - 2025-09-01T15:00:50.028377 - 100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:22<00:00, 1.18s/it]2025-09-01T15:00:50.029376 - 100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:22<00:00, 1.14s/it]2025-09-01T15:00:50.029376 - 2025-09-01T15:00:50.030370 - Restoring initial comfy attention2025-09-01T15:00:50.030370 - 2025-09-01T15:00:51.666354 - loaded completely 0.0 159.87335777282715 True 2025-09-01T15:00:52.027193 - comfyui lumi batcher overwrite task done2025-09-01T15:00:52.027193 - 2025-09-01T15:00:52.033721 - Prompt executed in 25.69 seconds 2025-09-01T15:00:57.732591 - FETCH ComfyRegistry Data: 70/962025-09-01T15:00:57.732591 - 2025-09-01T15:01:02.463536 - got prompt 2025-09-01T15:01:03.089034 - loaded completely 0.0 11350.067443847656 True 2025-09-01T15:01:03.098004 - Patching comfy attention to use sageattn2025-09-01T15:01:03.098004 - 2025-09-01T15:01:05.773837 - 15%|████████████▍ | 3/20 [00:02<00:17, 1.01s/it]2025-09-01T15:01:06.618083 - FETCH ComfyRegistry Data: 75/962025-09-01T15:01:06.618083 - 2025-09-01T15:01:15.225214 - 55%|█████████████████████████████████████████████ | 11/20 [00:12<00:10, 1.17s/it]2025-09-01T15:01:15.559178 - FETCH ComfyRegistry Data: 80/962025-09-01T15:01:15.559178 - 2025-09-01T15:01:23.462415 - 90%|█████████████████████████████████████████████████████████████████████████▊ | 18/20 [00:20<00:02, 1.18s/it]2025-09-01T15:01:24.532134 - FETCH ComfyRegistry Data: 85/962025-09-01T15:01:24.532134 - 2025-09-01T15:01:25.823332 - 100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:22<00:00, 1.18s/it]2025-09-01T15:01:25.824332 - 100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:22<00:00, 1.14s/it]2025-09-01T15:01:25.824332 - 2025-09-01T15:01:25.824332 - Restoring initial comfy attention2025-09-01T15:01:25.825360 - 2025-09-01T15:01:27.465611 - loaded completely 0.0 159.87335777282715 True 2025-09-01T15:01:27.822201 - comfyui lumi batcher overwrite task done2025-09-01T15:01:27.822201 - 2025-09-01T15:01:27.825191 - Prompt executed in 25.36 seconds 2025-09-01T15:01:33.620743 - FETCH ComfyRegistry Data: 90/962025-09-01T15:01:33.620743 - 2025-09-01T15:01:43.439162 - FETCH ComfyRegistry Data: 95/962025-09-01T15:01:43.439162 - 2025-09-01T15:01:45.474384 - FETCH ComfyRegistry Data [DONE]2025-09-01T15:01:45.474384 - 2025-09-01T15:01:45.625519 - [ComfyUI-Manager] default cache updated: https://api.comfy.org/nodes 2025-09-01T15:01:45.715218 - FETCH DATA from: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/custom-node-list.json2025-09-01T15:01:45.715218 - 2025-09-01T15:01:47.345156 - got prompt 2025-09-01T15:01:47.361993 - Requested to load Flux 2025-09-01T15:01:47.516137 - [DONE]2025-09-01T15:01:47.516137 - 2025-09-01T15:01:47.591887 - [ComfyUI-Manager] All startup tasks have been completed. 2025-09-01T15:01:48.028249 - loaded completely 0.0 11350.067443847656 True 2025-09-01T15:02:12.473821 - 100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:24<00:00, 1.26s/it]2025-09-01T15:02:12.474817 - 100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:24<00:00, 1.22s/it]2025-09-01T15:02:12.474817 - 2025-09-01T15:02:14.322793 - loaded completely 0.0 159.87335777282715 True 2025-09-01T15:02:14.683971 - comfyui lumi batcher overwrite task done2025-09-01T15:02:14.683971 - 2025-09-01T15:02:14.685964 - Prompt executed in 27.34 seconds 2025-09-01T15:02:19.663561 - got prompt 2025-09-01T15:02:20.178226 - loaded completely 0.0 11350.067443847656 True 2025-09-01T15:02:44.645309 - 100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:24<00:00, 1.25s/it]2025-09-01T15:02:44.646305 - 100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:24<00:00, 1.22s/it]2025-09-01T15:02:44.646305 - 2025-09-01T15:02:46.461739 - loaded completely 0.0 159.87335777282715 True 2025-09-01T15:02:46.818816 - comfyui lumi batcher overwrite task done2025-09-01T15:02:46.818816 - 2025-09-01T15:02:46.820813 - Prompt executed in 27.16 seconds 2025-09-01T15:02:53.822858 - got prompt 2025-09-01T15:02:53.845781 - Requested to load Flux 2025-09-01T15:02:54.625791 - loaded completely 0.0 11350.067443847656 True 2025-09-01T15:02:54.635757 - Patching comfy attention to use sageattn2025-09-01T15:02:54.635757 - 2025-09-01T15:03:17.948689 - 100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:23<00:00, 1.19s/it]2025-09-01T15:03:17.950687 - 100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:23<00:00, 1.17s/it]2025-09-01T15:03:17.951683 - 2025-09-01T15:03:17.953675 - Restoring initial comfy attention2025-09-01T15:03:17.953675 - 2025-09-01T15:03:19.664335 - loaded completely 0.0 159.87335777282715 True 2025-09-01T15:03:20.021412 - comfyui lumi batcher overwrite task done2025-09-01T15:03:20.021412 - 2025-09-01T15:03:20.027392 - Prompt executed in 26.20 seconds 2025-09-01T15:03:29.398450 - got prompt 2025-09-01T15:03:30.062602 - loaded completely 0.0 11350.067443847656 True 2025-09-01T15:03:30.071572 - Patching comfy attention to use sageattn2025-09-01T15:03:30.071572 - 2025-09-01T15:03:52.914438 - 100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:22<00:00, 1.17s/it]2025-09-01T15:03:52.915434 - 100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:22<00:00, 1.14s/it]2025-09-01T15:03:52.915434 - 2025-09-01T15:03:52.916431 - Restoring initial comfy attention2025-09-01T15:03:52.916431 - 2025-09-01T15:03:54.593879 - loaded completely 0.0 159.87335777282715 True 2025-09-01T15:03:54.936053 - comfyui lumi batcher overwrite task done2025-09-01T15:03:54.937051 - 2025-09-01T15:03:54.938046 - Prompt executed in 25.54 seconds 2025-09-01T15:05:17.191259 - got prompt 2025-09-01T15:05:17.823083 - loaded completely 0.0 11350.067443847656 True 2025-09-01T15:05:17.832052 - Patching comfy attention to use sageattn2025-09-01T15:05:17.833050 - 2025-09-01T15:05:40.406129 - 100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:22<00:00, 1.16s/it]2025-09-01T15:05:40.406129 - 100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:22<00:00, 1.13s/it]2025-09-01T15:05:40.406999 - 2025-09-01T15:05:40.407512 - Restoring initial comfy attention2025-09-01T15:05:40.407512 - 2025-09-01T15:05:42.007023 - loaded completely 0.0 159.87335777282715 True 2025-09-01T15:05:42.368928 - comfyui lumi batcher overwrite task done2025-09-01T15:05:42.368928 - 2025-09-01T15:05:42.370921 - Prompt executed in 25.18 seconds 2025-09-01T15:18:47.644508 - got prompt 2025-09-01T15:18:59.759942 - T5Encoder: 29%|███████████████████████████████████████████████████████▏ | 7/24 [00:00<00:00, 69.54it/s]2025-09-01T15:18:59.794825 - T5Encoder: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 24/24 [00:00<00:00, 177.06it/s]2025-09-01T15:18:59.795821 - 2025-09-01T15:19:00.091094 - T5Encoder: 0%| | 0/24 [00:00<?, ?it/s]2025-09-01T15:19:00.139935 - T5Encoder: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 24/24 [00:00<00:00, 501.63it/s]2025-09-01T15:19:00.140927 - 2025-09-01T15:19:16.616558 - CUDA Compute Capability: 8.9 2025-09-01T15:19:16.616558 - Detected model in_channels: 16 2025-09-01T15:19:16.617551 - Model cross attention type: t2v, num_heads: 40, num_layers: 40 2025-09-01T15:19:16.618547 - Model variant detected: 14B 2025-09-01T15:19:17.079385 - model_type FLOW 2025-09-01T15:19:17.592839 - Loading LoRA: Wan2.2加速\Wan21_T2V_14B_lightx2v_cfg_step_distill_lora_rank32 with strength: 3.0 2025-09-01T15:19:17.807323 - Using accelerate to load and assign model weights to device... 2025-09-01T15:19:24.630193 - Loading transformer parameters to cuda:0: 83%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▌ | 906/1095 [00:06<00:00, 966.70it/s]2025-09-01T15:19:24.655110 - Loading transformer parameters to cuda:0: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1095/1095 [00:06<00:00, 159.93it/s]2025-09-01T15:19:24.656107 - 2025-09-01T15:19:24.657103 - Using 1052 LoRA weight patches for WanVideo model 2025-09-01T15:19:25.598506 - sigmas: tensor([1.0000, 0.9600, 0.8889, 0.7272, 0.0000]) 2025-09-01T15:19:25.599502 - timesteps: tensor([999, 959, 888, 727], device='cuda:0') 2025-09-01T15:19:25.599502 - Using per-step cfg list: [2.0, 1.0, 1.0, 1.0] 2025-09-01T15:19:25.973765 - Input sequence length: 31050 2025-09-01T15:19:25.973765 - Sampling 89 frames at 720x480 with 4 steps 2025-09-01T15:21:45.420019 - 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [02:19<00:00, 26.10s/it]2025-09-01T15:21:45.421016 - 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [02:19<00:00, 34.77s/it]2025-09-01T15:21:45.421016 - 2025-09-01T15:21:47.906432 - Allocated memory: memory=0.097 GB 2025-09-01T15:21:47.906432 - Max allocated memory: max_memory=12.714 GB 2025-09-01T15:21:47.907430 - Max reserved memory: max_reserved=12.938 GB 2025-09-01T15:21:48.211045 - CUDA Compute Capability: 8.9 2025-09-01T15:21:48.211045 - Detected model in_channels: 16 2025-09-01T15:21:48.212042 - Model cross attention type: t2v, num_heads: 40, num_layers: 40 2025-09-01T15:21:48.213039 - Model variant detected: 14B 2025-09-01T15:21:48.689720 - model_type FLOW 2025-09-01T15:21:49.195154 - Loading LoRA: Wan2.2加速\Wan21_T2V_14B_lightx2v_cfg_step_distill_lora_rank32 with strength: 1.0 2025-09-01T15:21:49.294817 - Using accelerate to load and assign model weights to device... 2025-09-01T15:21:58.279127 - Loading transformer parameters to cuda:0: 51%|█████████████████████████████████████████████████████████████████████████████▊ | 553/1095 [00:08<00:18, 29.40it/s]2025-09-01T15:21:58.373810 - Loading transformer parameters to cuda:0: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1095/1095 [00:09<00:00, 120.63it/s]2025-09-01T15:21:58.373810 - 2025-09-01T15:21:58.386767 - Using 1052 LoRA weight patches for WanVideo model 2025-09-01T15:21:58.555691 - sigmas: tensor([0.]) 2025-09-01T15:21:58.556688 - timesteps: tensor([], device='cuda:0', dtype=torch.int64) 2025-09-01T15:22:00.877498 - Input sequence length: 31050 2025-09-01T15:22:00.878495 - Sampling 89 frames at 720x480 with 0 steps 2025-09-01T15:22:01.295938 - 0it [00:00, ?it/s]2025-09-01T15:22:01.297932 - 0it [00:00, ?it/s]2025-09-01T15:22:01.297932 - 2025-09-01T15:22:01.847336 - Allocated memory: memory=0.053 GB 2025-09-01T15:22:01.847336 - Max allocated memory: max_memory=7.034 GB 2025-09-01T15:22:01.847336 - Max reserved memory: max_reserved=7.094 GB 2025-09-01T15:22:02.003449 - !!! Exception during processing !!! cannot access local variable 'callback_latent' where it is not associated with a value 2025-09-01T15:22:02.009429 - Traceback (most recent call last): File "G:\comfyui\ComfyUI\execution.py", line 496, in execute output_data, output_ui, has_subgraph, has_pending_tasks = await get_output_data(prompt_id, unique_id, obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, hidden_inputs=hidden_inputs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "G:\comfyui\ComfyUI\execution.py", line 315, in get_output_data return_values = await _async_map_node_over_list(prompt_id, unique_id, obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, hidden_inputs=hidden_inputs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "G:\comfyui\ComfyUI\execution.py", line 289, in _async_map_node_over_list await process_inputs(input_dict, i) File "G:\comfyui\ComfyUI\execution.py", line 277, in process_inputs result = f(**inputs) ^^^^^^^^^^^ File "G:\comfyui\ComfyUI\custom_nodes\ComfyUI-WanVideoWrapper\nodes.py", line 3988, in process "samples": callback_latent.unsqueeze(0).cpu() if callback is not None else None, ^^^^^^^^^^^^^^^ UnboundLocalError: cannot access local variable 'callback_latent' where it is not associated with a value 2025-09-01T15:22:02.017402 - comfyui lumi batcher overwrite task done2025-09-01T15:22:02.017402 - 2025-09-01T15:22:02.024379 - Prompt executed in 194.37 seconds 2025-09-01T15:26:18.533291 - got prompt 2025-09-01T15:26:18.565355 - Using accelerate to load and assign model weights to device... 2025-09-01T15:26:25.545938 - Loading transformer parameters to cuda:0: 64%|█████████████████████████████████████████████████████████████████████████████████████████████████▌ | 698/1095 [00:06<00:00, 569.60it/s]2025-09-01T15:26:25.588794 - Loading transformer parameters to cuda:0: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1095/1095 [00:07<00:00, 155.95it/s]2025-09-01T15:26:25.588794 - 2025-09-01T15:26:25.589791 - Using 1052 LoRA weight patches for WanVideo model 2025-09-01T15:26:25.652581 - sigmas: tensor([1.0000, 0.9600, 0.8889, 0.7272, 0.0000]) 2025-09-01T15:26:25.652581 - timesteps: tensor([999, 959, 888, 727], device='cuda:0') 2025-09-01T15:26:25.654574 - Using per-step cfg list: [2.0, 1.0, 1.0, 1.0] 2025-09-01T15:26:26.099813 - Input sequence length: 31050 2025-09-01T15:26:26.099813 - Sampling 89 frames at 720x480 with 4 steps 2025-09-01T15:28:34.761959 - 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [02:08<00:00, 24.73s/it]2025-09-01T15:28:34.763951 - 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [02:08<00:00, 32.06s/it]2025-09-01T15:28:34.764948 - 2025-09-01T15:28:37.388334 - Allocated memory: memory=0.097 GB 2025-09-01T15:28:37.389330 - Max allocated memory: max_memory=11.671 GB 2025-09-01T15:28:37.390934 - Max reserved memory: max_reserved=12.312 GB 2025-09-01T15:28:37.402353 - Using accelerate to load and assign model weights to device... 2025-09-01T15:28:42.447834 - Loading transformer parameters to cuda:0: 47%|████████████████████████████████████████████████████████████████████████▍ | 518/1095 [00:05<00:02, 266.27it/s]2025-09-01T15:28:42.541592 - Loading transformer parameters to cuda:0: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1095/1095 [00:05<00:00, 213.15it/s]2025-09-01T15:28:42.541592 - 2025-09-01T15:28:42.542513 - Using 1052 LoRA weight patches for WanVideo model 2025-09-01T15:28:42.585369 - sigmas: tensor([0.]) 2025-09-01T15:28:42.585369 - timesteps: tensor([], device='cuda:0', dtype=torch.int64) 2025-09-01T15:28:42.834138 - Input sequence length: 31050 2025-09-01T15:28:42.835132 - Sampling 89 frames at 720x480 with 0 steps 2025-09-01T15:28:43.084302 - 0it [00:00, ?it/s]2025-09-01T15:28:43.089282 - 0it [00:00, ?it/s]2025-09-01T15:28:43.089282 - 2025-09-01T15:28:43.383958 - Allocated memory: memory=0.053 GB 2025-09-01T15:28:43.383958 - Max allocated memory: max_memory=7.034 GB 2025-09-01T15:28:43.384950 - Max reserved memory: max_reserved=7.094 GB 2025-09-01T15:28:43.414091 - !!! Exception during processing !!! cannot access local variable 'callback_latent' where it is not associated with a value 2025-09-01T15:28:43.418074 - Traceback (most recent call last): File "G:\comfyui\ComfyUI\execution.py", line 496, in execute output_data, output_ui, has_subgraph, has_pending_tasks = await get_output_data(prompt_id, unique_id, obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, hidden_inputs=hidden_inputs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "G:\comfyui\ComfyUI\execution.py", line 315, in get_output_data return_values = await _async_map_node_over_list(prompt_id, unique_id, obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, hidden_inputs=hidden_inputs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "G:\comfyui\ComfyUI\execution.py", line 289, in _async_map_node_over_list await process_inputs(input_dict, i) File "G:\comfyui\ComfyUI\execution.py", line 277, in process_inputs result = f(**inputs) ^^^^^^^^^^^ File "G:\comfyui\ComfyUI\custom_nodes\ComfyUI-WanVideoWrapper\nodes.py", line 3988, in process "samples": callback_latent.unsqueeze(0).cpu() if callback is not None else None, ^^^^^^^^^^^^^^^ UnboundLocalError: cannot access local variable 'callback_latent' where it is not associated with a value 2025-09-01T15:28:43.423058 - comfyui lumi batcher overwrite task done2025-09-01T15:28:43.423058 - 2025-09-01T15:28:43.428044 - Prompt executed in 144.88 seconds ``` ## Attached Workflow Please make sure that workflow does not contain any sensitive information such as API keys or passwords. ``` Workflow too large. Please manually upload the workflow from local file system. ``` ## Additional Context (Please add any additional context or steps to reproduce the error here) 报错的原因,怎么解决
09-02
# ComfyUI Error Report ## Error Details - **Node ID:** 5 - **Node Type:** Joy_caption_two - **Exception Type:** RuntimeError - **Exception Message:** All input tensors need to be on the same GPU, but found some tensors to not be on a GPU: [(torch.Size([1, 8388608]), device(type='cpu')), (torch.Size([262144]), device(type='cpu')), (torch.Size([4096, 4096]), device(type='cpu'))] ## Stack Trace ``` File "C:\comfyui2\ComfyUI\execution.py", line 349, 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 "C:\comfyui2\ComfyUI\execution.py", line 224, 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 "C:\comfyui2\ComfyUI\execution.py", line 196, in _map_node_over_list process_inputs(input_dict, i) File "C:\comfyui2\ComfyUI\execution.py", line 185, in process_inputs results.append(getattr(obj, func)(**inputs)) File "C:\comfyui2\ComfyUI\custom_nodes\ComfyUI_SLK_joy_caption_two\joy_caption_two_node.py", line 407, in generate generate_ids = text_model.generate(input_ids, inputs_embeds=input_embeds, attention_mask=attention_mask, File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\utils\_contextlib.py", line 116, in decorate_context return func(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\transformers\generation\utils.py", line 2215, in generate result = self._sample( File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\transformers\generation\utils.py", line 3206, in _sample outputs = self(**model_inputs, return_dict=True) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1751, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1762, in _call_impl return forward_call(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\transformers\models\llama\modeling_llama.py", line 1190, in forward outputs = self.model( File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1751, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1762, in _call_impl return forward_call(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\transformers\models\llama\modeling_llama.py", line 945, in forward layer_outputs = decoder_layer( File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1751, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1762, in _call_impl return forward_call(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\transformers\models\llama\modeling_llama.py", line 676, in forward hidden_states, self_attn_weights, present_key_value = self.self_attn( File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1751, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1762, in _call_impl return forward_call(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\transformers\models\llama\modeling_llama.py", line 559, in forward query_states = self.q_proj(hidden_states) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1751, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1762, in _call_impl return forward_call(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\peft\tuners\lora\bnb.py", line 467, in forward result = self.base_layer(x, *args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1751, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1762, in _call_impl return forward_call(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\bitsandbytes\nn\modules.py", line 484, in forward return bnb.matmul_4bit(x, self.weight.t(), bias=bias, quant_state=self.weight.quant_state).to(inp_dtype) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\bitsandbytes\autograd\_functions.py", line 533, in matmul_4bit return MatMul4Bit.apply(A, B, out, bias, quant_state) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\autograd\function.py", line 575, in apply return super().apply(*args, **kwargs) # type: ignore[misc] File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\bitsandbytes\autograd\_functions.py", line 462, in forward output = torch.nn.functional.linear(A, F.dequantize_4bit(B, quant_state).to(A.dtype).t(), bias) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\bitsandbytes\functional.py", line 1363, in dequantize_4bit is_on_gpu([A, absmax, out]) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\bitsandbytes\functional.py", line 464, in is_on_gpu raise RuntimeError( ``` ## System Information - **ComfyUI Version:** 0.3.33 - **Arguments:** main.py - **OS:** nt - **Python Version:** 3.10.11 (tags/v3.10.11:7d4cc5a, Apr 5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)] - **Embedded Python:** false - **PyTorch Version:** 2.7.0+cu126 ## Devices - **Name:** cuda:0 NVIDIA GeForce GTX 1660 Ti : cudaMallocAsync - **Type:** cuda - **VRAM Total:** 6442123264 - **VRAM Free:** 5379194880 - **Torch VRAM Total:** 0 - **Torch VRAM Free:** 0 ## Logs ``` 2025-05-12T12:33:00.245025 - Adding extra search path checkpoints C:\baidunetdiskdownload\sd-webui-aki\sd-webui-aki-v4.10\models\Stable-diffusion 2025-05-12T12:33:00.245025 - Adding extra search path configs C:\baidunetdiskdownload\sd-webui-aki\sd-webui-aki-v4.10\models\Stable-diffusion 2025-05-12T12:33:00.246022 - Adding extra search path vae C:\baidunetdiskdownload\sd-webui-aki\sd-webui-aki-v4.10\models\VAE 2025-05-12T12:33:00.246022 - Adding extra search path loras C:\baidunetdiskdownload\sd-webui-aki\sd-webui-aki-v4.10\models\Lora 2025-05-12T12:33:00.246022 - Adding extra search path loras C:\baidunetdiskdownload\sd-webui-aki\sd-webui-aki-v4.10\models\LyCORIS 2025-05-12T12:33:00.247019 - Adding extra search path upscale_models C:\baidunetdiskdownload\sd-webui-aki\sd-webui-aki-v4.10\models\ESRGAN 2025-05-12T12:33:00.247019 - Adding extra search path upscale_models C:\baidunetdiskdownload\sd-webui-aki\sd-webui-aki-v4.10\models\RealESRGAN 2025-05-12T12:33:00.247019 - Adding extra search path upscale_models C:\baidunetdiskdownload\sd-webui-aki\sd-webui-aki-v4.10\models\SwinIR 2025-05-12T12:33:00.247019 - Adding extra search path embeddings C:\baidunetdiskdownload\sd-webui-aki\sd-webui-aki-v4.10\embeddings 2025-05-12T12:33:00.247019 - Adding extra search path hypernetworks C:\baidunetdiskdownload\sd-webui-aki\sd-webui-aki-v4.10\models\hypernetworks 2025-05-12T12:33:00.248017 - Adding extra search path controlnet C:\baidunetdiskdownload\sd-webui-aki\sd-webui-aki-v4.10\extensions\sd-webui-controlnet 2025-05-12T12:33:00.823554 - [START] Security scan2025-05-12T12:33:00.823554 - 2025-05-12T12:33:02.367066 - [DONE] Security scan2025-05-12T12:33:02.367066 - 2025-05-12T12:33:02.643316 - ## ComfyUI-Manager: installing dependencies done.2025-05-12T12:33:02.643316 - 2025-05-12T12:33:02.643316 - ** ComfyUI startup time:2025-05-12T12:33:02.644221 - 2025-05-12T12:33:02.644221 - 2025-05-12 12:33:02.6432025-05-12T12:33:02.644221 - 2025-05-12T12:33:02.644221 - ** Platform:2025-05-12T12:33:02.644221 - 2025-05-12T12:33:02.644221 - Windows2025-05-12T12:33:02.645181 - 2025-05-12T12:33:02.645181 - ** Python version:2025-05-12T12:33:02.645181 - 2025-05-12T12:33:02.645181 - 3.10.11 (tags/v3.10.11:7d4cc5a, Apr 5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]2025-05-12T12:33:02.645181 - 2025-05-12T12:33:02.645181 - ** Python executable:2025-05-12T12:33:02.645181 - 2025-05-12T12:33:02.646180 - C:\Users\张三\AppData\Local\Programs\Python\Python310\python.exe2025-05-12T12:33:02.646180 - 2025-05-12T12:33:02.646180 - ** ComfyUI Path:2025-05-12T12:33:02.646180 - 2025-05-12T12:33:02.646180 - C:\comfyui2\ComfyUI2025-05-12T12:33:02.646180 - 2025-05-12T12:33:02.646180 - ** ComfyUI Base Folder Path:2025-05-12T12:33:02.647178 - 2025-05-12T12:33:02.647178 - C:\comfyui2\ComfyUI2025-05-12T12:33:02.647178 - 2025-05-12T12:33:02.647178 - ** User directory:2025-05-12T12:33:02.647178 - 2025-05-12T12:33:02.648176 - C:\comfyui2\ComfyUI\user2025-05-12T12:33:02.648176 - 2025-05-12T12:33:02.648176 - ** ComfyUI-Manager config path:2025-05-12T12:33:02.648176 - 2025-05-12T12:33:02.648176 - C:\comfyui2\ComfyUI\user\default\ComfyUI-Manager\config.ini2025-05-12T12:33:02.648176 - 2025-05-12T12:33:02.648176 - ** Log path:2025-05-12T12:33:02.648176 - 2025-05-12T12:33:02.648176 - C:\comfyui2\ComfyUI\user\comfyui.log2025-05-12T12:33:02.648176 - 2025-05-12T12:33:04.301068 - Prestartup times for custom nodes: 2025-05-12T12:33:04.302066 - 0.0 seconds: C:\comfyui2\ComfyUI\custom_nodes\comfyui-easy-use 2025-05-12T12:33:04.302066 - 4.1 seconds: C:\comfyui2\ComfyUI\custom_nodes\ComfyUI-Manager 2025-05-12T12:33:04.302066 - 2025-05-12T12:33:06.807275 - Checkpoint files will always be loaded safely. 2025-05-12T12:33:07.017820 - Total VRAM 6144 MB, total RAM 16294 MB 2025-05-12T12:33:07.018365 - pytorch version: 2.7.0+cu126 2025-05-12T12:33:09.352975 - xformers version: 0.0.30 2025-05-12T12:33:09.352975 - Set vram state to: NORMAL_VRAM 2025-05-12T12:33:09.352975 - Device: cuda:0 NVIDIA GeForce GTX 1660 Ti : cudaMallocAsync 2025-05-12T12:33:09.686612 - Using xformers attention 2025-05-12T12:33:11.295329 - Python version: 3.10.11 (tags/v3.10.11:7d4cc5a, Apr 5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)] 2025-05-12T12:33:11.295743 - ComfyUI version: 0.3.33 2025-05-12T12:33:11.358578 - ComfyUI frontend version: 1.18.10 2025-05-12T12:33:11.361570 - [Prompt Server] web root: C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\comfyui_frontend_package\static 2025-05-12T12:33:13.337748 - Module 'diffusers' load failed. If you don't have it installed, do it:2025-05-12T12:33:13.338688 - 2025-05-12T12:33:13.339179 - pip install diffusers2025-05-12T12:33:13.339179 - 2025-05-12T12:33:13.688119 - [ComfyUI-Easy-Use] server: v1.3.0 Loaded2025-05-12T12:33:13.688119 - 2025-05-12T12:33:13.688119 - [ComfyUI-Easy-Use] web root: C:\comfyui2\ComfyUI\custom_nodes\comfyui-easy-use\web_version/v2 Loaded2025-05-12T12:33:13.689074 - 2025-05-12T12:33:13.717123 - ### Loading: ComfyUI-Manager (V3.31.13) 2025-05-12T12:33:13.717123 - [ComfyUI-Manager] network_mode: public 2025-05-12T12:33:14.072667 - ### ComfyUI Version: v0.3.33-10-g577de83c | Released on '2025-05-11' 2025-05-12T12:33:14.311459 - Import times for custom nodes: 2025-05-12T12:33:14.311459 - 0.0 seconds: C:\comfyui2\ComfyUI\custom_nodes\websocket_image_save.py 2025-05-12T12:33:14.313453 - 0.0 seconds: C:\comfyui2\ComfyUI\custom_nodes\aigodlike-comfyui-translation 2025-05-12T12:33:14.313453 - 0.0 seconds: C:\comfyui2\ComfyUI\custom_nodes\ComfyUI_SLK_joy_caption_two 2025-05-12T12:33:14.314451 - 0.0 seconds: C:\comfyui2\ComfyUI\custom_nodes\comfyui-custom-scripts 2025-05-12T12:33:14.314451 - 0.6 seconds: C:\comfyui2\ComfyUI\custom_nodes\ComfyUI-Manager 2025-05-12T12:33:14.315449 - 0.7 seconds: C:\comfyui2\ComfyUI\custom_nodes\comfyui-easy-use 2025-05-12T12:33:14.315449 - 2025-05-12T12:33:14.362371 - Starting server 2025-05-12T12:33:14.363371 - To see the GUI go to: http://127.0.0.1:8188 2025-05-12T12:33:19.620936 - [ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/model-list.json 2025-05-12T12:33:19.678088 - [ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/extension-node-map.json 2025-05-12T12:33:19.845706 - [ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/alter-list.json 2025-05-12T12:33:19.955392 - [ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/github-stats.json 2025-05-12T12:33:20.436522 - [ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/custom-node-list.json 2025-05-12T12:34:14.934119 - Cannot connect to comfyregistry.2025-05-12T12:34:14.934119 - 2025-05-12T12:34:14.940242 - FETCH DATA from: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/custom-node-list.json2025-05-12T12:34:14.940242 - 2025-05-12T12:34:19.785536 - got prompt 2025-05-12T12:34:19.982016 - C:\comfyui2\ComfyUI\models\clip\siglip-so400m-patch14-3842025-05-12T12:34:19.982016 - 2025-05-12T12:34:20.277243 - [DONE]2025-05-12T12:34:20.277243 - 2025-05-12T12:34:20.377933 - [ComfyUI-Manager] All startup tasks have been completed. 2025-05-12T12:34:26.095833 - Loading VLM's custom vision model2025-05-12T12:34:26.096832 - 2025-05-12T12:34:28.260562 - Requested to load SiglipVisionTransformer 2025-05-12T12:34:28.272048 - loaded completely 9.5367431640625e+25 809.1729736328125 True 2025-05-12T12:34:53.793004 - Requested to load ImageAdapter 2025-05-12T12:34:53.793004 - loaded completely 9.5367431640625e+25 41.0390625 True 2025-05-12T12:35:10.488040 - Loading tokenizer2025-05-12T12:35:10.488040 - 2025-05-12T12:35:11.002348 - Loading LLM: unsloth/Meta-Llama-3.1-8B-Instruct-bnb-4bit2025-05-12T12:35:11.003346 - 2025-05-12T12:35:11.003346 - C:\comfyui2\ComfyUI\models\LLM\Meta-Llama-3.1-8B-Instruct-bnb-4bit2025-05-12T12:35:11.003346 - 2025-05-12T12:35:11.005339 - Successfully modified 'base_model_name_or_path' value in 'C:\comfyui2\ComfyUI\models\Joy_caption_two\text_model\adapter_config.json'.2025-05-12T12:35:11.005339 - 2025-05-12T12:35:24.237554 - Unused kwargs: ['_load_in_4bit', '_load_in_8bit', 'quant_method']. These kwargs are not used in <class 'transformers.utils.quantization_config.BitsAndBytesConfig'>. 2025-05-12T12:35:30.940677 - !!! Exception during processing !!! All input tensors need to be on the same GPU, but found some tensors to not be on a GPU: [(torch.Size([1, 8388608]), device(type='cpu')), (torch.Size([262144]), device(type='cpu')), (torch.Size([4096, 4096]), device(type='cpu'))] 2025-05-12T12:35:30.962005 - Traceback (most recent call last): File "C:\comfyui2\ComfyUI\execution.py", line 349, 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 "C:\comfyui2\ComfyUI\execution.py", line 224, 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 "C:\comfyui2\ComfyUI\execution.py", line 196, in _map_node_over_list process_inputs(input_dict, i) File "C:\comfyui2\ComfyUI\execution.py", line 185, in process_inputs results.append(getattr(obj, func)(**inputs)) File "C:\comfyui2\ComfyUI\custom_nodes\ComfyUI_SLK_joy_caption_two\joy_caption_two_node.py", line 407, in generate generate_ids = text_model.generate(input_ids, inputs_embeds=input_embeds, attention_mask=attention_mask, File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\utils\_contextlib.py", line 116, in decorate_context return func(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\transformers\generation\utils.py", line 2215, in generate result = self._sample( File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\transformers\generation\utils.py", line 3206, in _sample outputs = self(**model_inputs, return_dict=True) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1751, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1762, in _call_impl return forward_call(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\transformers\models\llama\modeling_llama.py", line 1190, in forward outputs = self.model( File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1751, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1762, in _call_impl return forward_call(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\transformers\models\llama\modeling_llama.py", line 945, in forward layer_outputs = decoder_layer( File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1751, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1762, in _call_impl return forward_call(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\transformers\models\llama\modeling_llama.py", line 676, in forward hidden_states, self_attn_weights, present_key_value = self.self_attn( File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1751, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1762, in _call_impl return forward_call(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\transformers\models\llama\modeling_llama.py", line 559, in forward query_states = self.q_proj(hidden_states) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1751, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1762, in _call_impl return forward_call(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\peft\tuners\lora\bnb.py", line 467, in forward result = self.base_layer(x, *args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1751, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1762, in _call_impl return forward_call(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\bitsandbytes\nn\modules.py", line 484, in forward return bnb.matmul_4bit(x, self.weight.t(), bias=bias, quant_state=self.weight.quant_state).to(inp_dtype) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\bitsandbytes\autograd\_functions.py", line 533, in matmul_4bit return MatMul4Bit.apply(A, B, out, bias, quant_state) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\autograd\function.py", line 575, in apply return super().apply(*args, **kwargs) # type: ignore[misc] File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\bitsandbytes\autograd\_functions.py", line 462, in forward output = torch.nn.functional.linear(A, F.dequantize_4bit(B, quant_state).to(A.dtype).t(), bias) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\bitsandbytes\functional.py", line 1363, in dequantize_4bit is_on_gpu([A, absmax, out]) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\bitsandbytes\functional.py", line 464, in is_on_gpu raise RuntimeError( RuntimeError: All input tensors need to be on the same GPU, but found some tensors to not be on a GPU: [(torch.Size([1, 8388608]), device(type='cpu')), (torch.Size([262144]), device(type='cpu')), (torch.Size([4096, 4096]), device(type='cpu'))] 2025-05-12T12:35:30.967286 - Prompt executed in 71.18 seconds 2025-05-12T12:51:12.715731 - got prompt 2025-05-12T12:51:12.907212 - loaded completely 9.5367431640625e+25 809.1729736328125 True 2025-05-12T12:51:36.518268 - loaded completely 9.5367431640625e+25 41.0390625 True 2025-05-12T12:51:53.412534 - !!! Exception during processing !!! All input tensors need to be on the same GPU, but found some tensors to not be on a GPU: [(torch.Size([1, 8388608]), device(type='cpu')), (torch.Size([262144]), device(type='cpu')), (torch.Size([4096, 4096]), device(type='cpu'))] 2025-05-12T12:51:53.419550 - Traceback (most recent call last): File "C:\comfyui2\ComfyUI\execution.py", line 349, 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 "C:\comfyui2\ComfyUI\execution.py", line 224, 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 "C:\comfyui2\ComfyUI\execution.py", line 196, in _map_node_over_list process_inputs(input_dict, i) File "C:\comfyui2\ComfyUI\execution.py", line 185, in process_inputs results.append(getattr(obj, func)(**inputs)) File "C:\comfyui2\ComfyUI\custom_nodes\ComfyUI_SLK_joy_caption_two\joy_caption_two_node.py", line 407, in generate generate_ids = text_model.generate(input_ids, inputs_embeds=input_embeds, attention_mask=attention_mask, File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\utils\_contextlib.py", line 116, in decorate_context return func(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\transformers\generation\utils.py", line 2215, in generate result = self._sample( File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\transformers\generation\utils.py", line 3206, in _sample outputs = self(**model_inputs, return_dict=True) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1751, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1762, in _call_impl return forward_call(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\transformers\models\llama\modeling_llama.py", line 1190, in forward outputs = self.model( File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1751, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1762, in _call_impl return forward_call(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\transformers\models\llama\modeling_llama.py", line 945, in forward layer_outputs = decoder_layer( File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1751, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1762, in _call_impl return forward_call(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\transformers\models\llama\modeling_llama.py", line 676, in forward hidden_states, self_attn_weights, present_key_value = self.self_attn( File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1751, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1762, in _call_impl return forward_call(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\transformers\models\llama\modeling_llama.py", line 559, in forward query_states = self.q_proj(hidden_states) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1751, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1762, in _call_impl return forward_call(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\peft\tuners\lora\bnb.py", line 467, in forward result = self.base_layer(x, *args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1751, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1762, in _call_impl return forward_call(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\bitsandbytes\nn\modules.py", line 484, in forward return bnb.matmul_4bit(x, self.weight.t(), bias=bias, quant_state=self.weight.quant_state).to(inp_dtype) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\bitsandbytes\autograd\_functions.py", line 533, in matmul_4bit return MatMul4Bit.apply(A, B, out, bias, quant_state) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\autograd\function.py", line 575, in apply return super().apply(*args, **kwargs) # type: ignore[misc] File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\bitsandbytes\autograd\_functions.py", line 462, in forward output = torch.nn.functional.linear(A, F.dequantize_4bit(B, quant_state).to(A.dtype).t(), bias) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\bitsandbytes\functional.py", line 1363, in dequantize_4bit is_on_gpu([A, absmax, out]) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\bitsandbytes\functional.py", line 464, in is_on_gpu raise RuntimeError( RuntimeError: All input tensors need to be on the same GPU, but found some tensors to not be on a GPU: [(torch.Size([1, 8388608]), device(type='cpu')), (torch.Size([262144]), device(type='cpu')), (torch.Size([4096, 4096]), device(type='cpu'))] 2025-05-12T12:51:53.426451 - Prompt executed in 40.69 seconds 2025-05-12T13:27:37.964284 - got prompt 2025-05-12T13:27:38.213613 - loaded completely 9.5367431640625e+25 809.1729736328125 True 2025-05-12T13:28:03.041961 - loaded completely 9.5367431640625e+25 41.0390625 True 2025-05-12T13:28:19.913094 - !!! Exception during processing !!! All input tensors need to be on the same GPU, but found some tensors to not be on a GPU: [(torch.Size([1, 8388608]), device(type='cpu')), (torch.Size([262144]), device(type='cpu')), (torch.Size([4096, 4096]), device(type='cpu'))] 2025-05-12T13:28:19.919269 - Traceback (most recent call last): File "C:\comfyui2\ComfyUI\execution.py", line 349, 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 "C:\comfyui2\ComfyUI\execution.py", line 224, 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 "C:\comfyui2\ComfyUI\execution.py", line 196, in _map_node_over_list process_inputs(input_dict, i) File "C:\comfyui2\ComfyUI\execution.py", line 185, in process_inputs results.append(getattr(obj, func)(**inputs)) File "C:\comfyui2\ComfyUI\custom_nodes\ComfyUI_SLK_joy_caption_two\joy_caption_two_node.py", line 407, in generate generate_ids = text_model.generate(input_ids, inputs_embeds=input_embeds, attention_mask=attention_mask, File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\utils\_contextlib.py", line 116, in decorate_context return func(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\transformers\generation\utils.py", line 2215, in generate result = self._sample( File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\transformers\generation\utils.py", line 3206, in _sample outputs = self(**model_inputs, return_dict=True) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1751, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1762, in _call_impl return forward_call(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\transformers\models\llama\modeling_llama.py", line 1190, in forward outputs = self.model( File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1751, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1762, in _call_impl return forward_call(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\transformers\models\llama\modeling_llama.py", line 945, in forward layer_outputs = decoder_layer( File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1751, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1762, in _call_impl return forward_call(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\transformers\models\llama\modeling_llama.py", line 676, in forward hidden_states, self_attn_weights, present_key_value = self.self_attn( File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1751, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1762, in _call_impl return forward_call(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\transformers\models\llama\modeling_llama.py", line 559, in forward query_states = self.q_proj(hidden_states) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1751, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1762, in _call_impl return forward_call(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\peft\tuners\lora\bnb.py", line 467, in forward result = self.base_layer(x, *args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1751, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1762, in _call_impl return forward_call(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\bitsandbytes\nn\modules.py", line 484, in forward return bnb.matmul_4bit(x, self.weight.t(), bias=bias, quant_state=self.weight.quant_state).to(inp_dtype) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\bitsandbytes\autograd\_functions.py", line 533, in matmul_4bit return MatMul4Bit.apply(A, B, out, bias, quant_state) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\autograd\function.py", line 575, in apply return super().apply(*args, **kwargs) # type: ignore[misc] File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\bitsandbytes\autograd\_functions.py", line 462, in forward output = torch.nn.functional.linear(A, F.dequantize_4bit(B, quant_state).to(A.dtype).t(), bias) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\bitsandbytes\functional.py", line 1363, in dequantize_4bit is_on_gpu([A, absmax, out]) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\bitsandbytes\functional.py", line 464, in is_on_gpu raise RuntimeError( RuntimeError: All input tensors need to be on the same GPU, but found some tensors to not be on a GPU: [(torch.Size([1, 8388608]), device(type='cpu')), (torch.Size([262144]), device(type='cpu')), (torch.Size([4096, 4096]), device(type='cpu'))] 2025-05-12T13:28:19.925246 - Prompt executed in 41.93 seconds 2025-05-12T14:01:51.529873 - got prompt 2025-05-12T14:01:51.690142 - loaded completely 9.5367431640625e+25 809.1729736328125 True 2025-05-12T14:01:56.251833 - [ComfyUI-Manager] The ComfyRegistry cache update is still in progress, so an outdated cache is being used.2025-05-12T14:01:56.251833 - 2025-05-12T14:01:56.355173 - FETCH DATA from: C:\comfyui2\ComfyUI\user\default\ComfyUI-Manager\cache\1514988643_custom-node-list.json2025-05-12T14:01:56.355173 - 2025-05-12T14:01:56.372727 - [DONE]2025-05-12T14:01:56.372727 - 2025-05-12T14:01:56.465008 - FETCH DATA from: C:\comfyui2\ComfyUI\user\default\ComfyUI-Manager\cache\746607195_github-stats.json2025-05-12T14:01:56.465008 - 2025-05-12T14:01:56.472987 - [DONE]2025-05-12T14:01:56.473984 - 2025-05-12T14:01:56.476976 - FETCH DATA from: C:\comfyui2\ComfyUI\user\default\ComfyUI-Manager\cache\832903789_extras.json2025-05-12T14:01:56.476976 - 2025-05-12T14:01:56.477973 - [DONE]2025-05-12T14:01:56.477973 - 2025-05-12T14:01:56.646551 - FETCH DATA from: C:\comfyui2\ComfyUI\user\default\ComfyUI-Manager\cache\1742899825_extension-node-map.json2025-05-12T14:01:56.646551 - 2025-05-12T14:01:56.656524 - [DONE]2025-05-12T14:01:56.656524 - 2025-05-12T14:02:15.505597 - loaded completely 9.5367431640625e+25 41.0390625 True 2025-05-12T14:02:31.244068 - !!! Exception during processing !!! All input tensors need to be on the same GPU, but found some tensors to not be on a GPU: [(torch.Size([1, 8388608]), device(type='cpu')), (torch.Size([262144]), device(type='cpu')), (torch.Size([4096, 4096]), device(type='cpu'))] 2025-05-12T14:02:31.248613 - Traceback (most recent call last): File "C:\comfyui2\ComfyUI\execution.py", line 349, 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 "C:\comfyui2\ComfyUI\execution.py", line 224, 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 "C:\comfyui2\ComfyUI\execution.py", line 196, in _map_node_over_list process_inputs(input_dict, i) File "C:\comfyui2\ComfyUI\execution.py", line 185, in process_inputs results.append(getattr(obj, func)(**inputs)) File "C:\comfyui2\ComfyUI\custom_nodes\ComfyUI_SLK_joy_caption_two\joy_caption_two_node.py", line 407, in generate generate_ids = text_model.generate(input_ids, inputs_embeds=input_embeds, attention_mask=attention_mask, File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\utils\_contextlib.py", line 116, in decorate_context return func(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\transformers\generation\utils.py", line 2215, in generate result = self._sample( File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\transformers\generation\utils.py", line 3206, in _sample outputs = self(**model_inputs, return_dict=True) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1751, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1762, in _call_impl return forward_call(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\transformers\models\llama\modeling_llama.py", line 1190, in forward outputs = self.model( File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1751, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1762, in _call_impl return forward_call(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\transformers\models\llama\modeling_llama.py", line 945, in forward layer_outputs = decoder_layer( File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1751, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1762, in _call_impl return forward_call(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\transformers\models\llama\modeling_llama.py", line 676, in forward hidden_states, self_attn_weights, present_key_value = self.self_attn( File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1751, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1762, in _call_impl return forward_call(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\transformers\models\llama\modeling_llama.py", line 559, in forward query_states = self.q_proj(hidden_states) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1751, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1762, in _call_impl return forward_call(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\peft\tuners\lora\bnb.py", line 467, in forward result = self.base_layer(x, *args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1751, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1762, in _call_impl return forward_call(*args, **kwargs) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\bitsandbytes\nn\modules.py", line 484, in forward return bnb.matmul_4bit(x, self.weight.t(), bias=bias, quant_state=self.weight.quant_state).to(inp_dtype) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\bitsandbytes\autograd\_functions.py", line 533, in matmul_4bit return MatMul4Bit.apply(A, B, out, bias, quant_state) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\autograd\function.py", line 575, in apply return super().apply(*args, **kwargs) # type: ignore[misc] File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\bitsandbytes\autograd\_functions.py", line 462, in forward output = torch.nn.functional.linear(A, F.dequantize_4bit(B, quant_state).to(A.dtype).t(), bias) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\bitsandbytes\functional.py", line 1363, in dequantize_4bit is_on_gpu([A, absmax, out]) File "C:\Users\张三\AppData\Local\Programs\Python\Python310\lib\site-packages\bitsandbytes\functional.py", line 464, in is_on_gpu raise RuntimeError( RuntimeError: All input tensors need to be on the same GPU, but found some tensors to not be on a GPU: [(torch.Size([1, 8388608]), device(type='cpu')), (torch.Size([262144]), device(type='cpu')), (torch.Size([4096, 4096]), device(type='cpu'))] 2025-05-12T14:02:31.253592 - Prompt executed in 39.72 seconds ``` ## Attached Workflow Please make sure that workflow does not contain any sensitive information such as API keys or passwords. ``` {"id":"00000000-0000-0000-0000-000000000000","revision":0,"last_node_id":6,"last_link_id":6,"nodes":[{"id":2,"type":"LoadImage","pos":[-536.7379150390625,-152.25942993164062],"size":[270,314],"flags":{},"order":0,"mode":0,"inputs":[{"label":"image","localized_name":"图像","name":"image","type":"COMBO","widget":{"name":"image"},"link":null},{"label":"upload","localized_name":"选择文件上传","name":"upload","type":"IMAGEUPLOAD","widget":{"name":"upload"},"link":null}],"outputs":[{"label":"IMAGE","localized_name":"图像","name":"IMAGE","type":"IMAGE","links":[5]},{"label":"MASK","localized_name":"遮罩","name":"MASK","type":"MASK","links":null}],"properties":{"cnr_id":"comfy-core","ver":"0.3.33","Node name for S&R":"LoadImage"},"widgets_values":["CN_6.jpg","image"]},{"id":4,"type":"ShowText|pysssss","pos":[247.84080505371094,74.16905975341797],"size":[366.1156921386719,159.55372619628906],"flags":{},"order":3,"mode":0,"inputs":[{"label":"text","localized_name":"text","name":"text","type":"STRING","link":4}],"outputs":[{"label":"STRING","localized_name":"字符串","name":"STRING","shape":6,"type":"STRING","links":null}],"properties":{"cnr_id":"comfyui-custom-scripts","ver":"1.2.5","Node name for S&R":"ShowText|pysssss"},"widgets_values":[]},{"id":6,"type":"Joy_caption_two_load","pos":[-148.00003051757812,-86.00003051757812],"size":[270,58],"flags":{},"order":1,"mode":0,"inputs":[{"label":"model","localized_name":"model","name":"model","type":"COMBO","widget":{"name":"model"},"link":null}],"outputs":[{"label":"JoyTwoPipeline","localized_name":"JoyTwoPipeline","name":"JoyTwoPipeline","type":"JoyTwoPipeline","links":[6]}],"properties":{"cnr_id":"comfyui_slk_joy_caption_two","ver":"667751cab945bd8e9fb0be4d557d47e36821350a","Node name for S&R":"Joy_caption_two_load"},"widgets_values":["unsloth/Meta-Llama-3.1-8B-Instruct-bnb-4bit"]},{"id":5,"type":"Joy_caption_two","pos":[-139.20001220703125,33.199951171875],"size":[270,126],"flags":{},"order":2,"mode":0,"inputs":[{"label":"joy_two_pipeline","localized_name":"joy_two_pipeline","name":"joy_two_pipeline","type":"JoyTwoPipeline","link":6},{"label":"image","localized_name":"image","name":"image","type":"IMAGE","link":5},{"label":"caption_type","localized_name":"caption_type","name":"caption_type","type":"COMBO","widget":{"name":"caption_type"},"link":null},{"label":"caption_length","localized_name":"caption_length","name":"caption_length","type":"COMBO","widget":{"name":"caption_length"},"link":null},{"label":"low_vram","localized_name":"low_vram","name":"low_vram","type":"BOOLEAN","widget":{"name":"low_vram"},"link":null}],"outputs":[{"label":"STRING","localized_name":"字符串","name":"STRING","type":"STRING","links":[4]}],"properties":{"cnr_id":"comfyui_slk_joy_caption_two","ver":"667751cab945bd8e9fb0be4d557d47e36821350a","Node name for S&R":"Joy_caption_two"},"widgets_values":["Descriptive","long",true]}],"links":[[4,5,0,4,0,"STRING"],[5,2,0,5,1,"IMAGE"],[6,6,0,5,0,"JoyTwoPipeline"]],"groups":[],"config":{},"extra":{"frontendVersion":"1.18.10"},"version":0.4} ``` ## Additional Context (Please add any additional context or steps to reproduce the error here) 以上代码是什么意思
05-14
AI-PPT 一键生成 PPT:用户输入主题关键词,AI-PPT 可快速生成完整 PPT,涵盖标题、正文、段落结构等,还支持对话式生成,用户可在 AI 交互窗口边查看边修改。 文档导入转 PPT:支持导入 Word、Excel、PDF 等多种格式文档,自动解析文档结构,将其转换为结构清晰、排版规范的 PPT,有保持原文和智能优化两种模式。 AI-PPT 对话 实时问答:用户上传 PPT 或 PPTX 文件后,可针对演示内容进行提问,AI 实时提供解答,帮助用户快速理解内容。 多角度内容分析:对 PPT 内容进行多角度分析,提供全面视野,帮助用户更好地把握内容结构和重点。 多语言对话支持:支持多语言对话,打破语言障碍,方便不同语言背景的用户使用。 AI - 绘图 文生图:用户输入文字描述,即可生成符合语义的不同风格图像,如油画、水彩、中国画等,支持中英文双语输入。 图生图:用户上传图片并输入描述,AI - 绘图能够根据参考图和描述生成新的风格化图像,适用于需要特定风格或元素的创作需求。 图像编辑:提供如 AI 超清、AI 扩图、AI 无痕消除等功能,用户可以上传图片进行细节修改和优化,提升图片质量。 AI - 文稿 文案生成:能够根据用户需求生成多种类型的文章,如市场营销文案、技术文档、内部沟通内容等,提升文案质量和创作效率。 文章润色:对已有文章进行改善和优化,包括语言表达、逻辑连贯性、内容流畅度等方面,使文章更符合用户期望和风格。 文章续写:AI 技术理解文本语境,为用户提供新的想法、补充资料或更深层次的见解,帮助用户丰富文档内容。 AI - 医生 智能健康咨询:包括症状自查,用户输入不适症状,AI 结合病史等信息提供疾病可能性分析与初步建议;用药指导,支持查询药品适应症、禁忌症等,并预警潜在冲突;中医辨证,提供体质辨识与调理建议。 医学报告解读:用户上传体检报告
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值