SD1:逻辑回归-分类问题

本文介绍了使用Python实现逻辑回归进行分类的方法,包括sigmoid函数、代价函数和梯度下降的详细步骤。通过加载数据、绘制散点图展示数据分布,并实现了逻辑回归的假设函数、代价函数计算以及梯度下降求解最优参数,最终计算分类器的精度。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1.sigmoid函数

2.代价函数
3.梯度下降

工具:Python3.6+pandas+numpy+scipy+matpotlib

代码实现:

#逻辑逻辑回归
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import scipy.optimize as opt


def todata():
    path='data.txt'#数据地址
    data=pd.read_csv(path,header=None,names=['DX','DY','Node_0_1'])
    return data
    # print(data.head())

#显示图形
def show_pc():
    data=todata()
   positive=data[data['Node_0_1'].isin([1])]
   negative=data[data['Node_0_1'].isin([0])]
    fig,ax=plt.subplots(figsize=(15,10))#绘制散点图
    ax.scatter(positive['DX'],positive['DY'],s=50,c='b',marker='o',label='Node_1')
   ax.scatter(negative['DX'],negative['DY'],s=50,c='r',marker='x',label='Node_0')
    ax.legend()
    ax.set_xlabel('DX Score')
    ax.set_ylabel('DY Score')
    plt.show()

#定义假设函数
def sigmoid(z):
    return 1/(1+np.exp(-z))

#绘制假设函数
def show_z():
    nums=np.arange(-15,15,step=1)
    fig,ax=plt.subplots(figsize=(15,10))
    ax.plot(nums,sigmoid(nums),'r')
    # plt.show()



#对数据做一些处理
def taking_data():
    data=todata()
    data.insert(0,'ones',1)
    cols=data.shape[1]
    X1=data.iloc[:,0:cols-1]
    y1=data.iloc[:,cols-1:cols]

    X=np.array(X1.values)
    y=np.array(y1.values)
    theta=np.zeros(3)
    return X,y,theta

#代价函数
def cost(theta,X,y):
    theta=np.matrix(theta)
    X=np.matrix(X)
    y=np.matrix(y)
   first=np.multiply(-y,np.log(sigmoid(X*theta.T)))
   second=np.multiply((1-y),np.log(1-sigmoid(X*theta.T)))
    return np.sum(first-second)/len(X)

#梯度下降
def gradients(theta,X,y):
    theta=np.matrix(theta)
    X=np.matrix(X)
    y=np.matrix(y)

   parameters=int(theta.ravel().shape[1])
    grads_n=np.zeros(parameters)

    error=sigmoid(X*theta.T)-y

    for i in range(parameters):
        term=np.multiply(error,X[:,i])
        grads_n[i]=np.sum(term)/len(X)
    return grads_n




#寻找最优参数
def result():
    X,y,theta=taking_data()
    cost(theta,X,y)
    gradients(theta,X,y)
   result=opt.fmin_tnc(func=cost,x0=theta,fprime=gradients,args=(X,y))
    return result


#计算分类器精度
def predict(theta,X):
    probability=sigmoid(X*theta.T)
    return [1 if x >=0.5 else 0 for xin probability]

if __name__=='__main__':
    show_pc()
    # show_z()
    X,y,theta=taking_data()
    result=result()
    theta_min=np.matrix(result[0])
    predictions=predict(theta_min,X)
    correct=[1 if ((a==1 and b==1) or(a==0 and b==0)) else 0 for (a,b) in zip(predictions,y)]
    accuray=(sum(map(int,correct)) %len(correct))
    print ('accuracy ={0}%'.format(accuray))

点击打开链接





# ComfyUI Error Report ## Error Details - **Node ID:** 42 - **Node Type:** WanVideoSampler - **Exception Type:** AttributeError - **Exception Message:** 'WanModel' object has no attribute 'vace_patch_embedding' ## Stack Trace ``` File "F:\ComfyUI_Mie_V6.0\ComfyUI\execution.py", line 361, 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 "F:\ComfyUI_Mie_V6.0\ComfyUI\execution.py", line 236, 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 "F:\ComfyUI_Mie_V6.0\ComfyUI\execution.py", line 208, in _map_node_over_list process_inputs(input_dict, i) File "F:\ComfyUI_Mie_V6.0\ComfyUI\execution.py", line 197, in process_inputs results.append(getattr(obj, func)(**inputs)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "F:\ComfyUI_Mie_V6.0\ComfyUI\custom_nodes\ComfyUI-WanVideoWrapper\nodes.py", line 3325, in process noise_pred, self.cache_state = predict_with_cfg( ^^^^^^^^^^^^^^^^^ File "F:\ComfyUI_Mie_V6.0\ComfyUI\custom_nodes\ComfyUI-WanVideoWrapper\nodes.py", line 2617, in predict_with_cfg noise_pred_cond, cache_state_cond = transformer( ^^^^^^^^^^^^ File "F:\ComfyUI_Mie_V6.0\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1751, in _wrapped_call_impl return self._call_impl(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "F:\ComfyUI_Mie_V6.0\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1762, in _call_impl return forward_call(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "F:\ComfyUI_Mie_V6.0\ComfyUI\custom_nodes\ComfyUI-WanVideoWrapper\wanvideo\modules\model.py", line 1617, in forward vace_hints = self.forward_vace(x, data["context"], data["seq_len"], kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "F:\ComfyUI_Mie_V6.0\ComfyUI\custom_nodes\ComfyUI-WanVideoWrapper\wanvideo\modules\model.py", line 1196, in forward_vace c = [self.vace_patch_embedding(u.unsqueeze(0).float()).to(x.dtype) for u in vace_context] ^^^^^^^^^^^^^^^^^^^^^^^^^ File "F:\ComfyUI_Mie_V6.0\python_embeded\Lib\site-packages\diffusers\models\modeling_utils.py", line 291, in __getattr__ return super().__getattr__(name) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "F:\ComfyUI_Mie_V6.0\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1940, in __getattr__ raise AttributeError( ``` ## System Information - **ComfyUI Version:** 0.3.43 - **Arguments:** ComfyUI\main.py --windows-standalone-build --listen 0.0.0.0 --enable-cors-header * - **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:** true - **PyTorch Version:** 2.7.1+cu128 ## Devices - **Name:** cuda:0 NVIDIA GeForce RTX 3090 : cudaMallocAsync - **Type:** cuda - **VRAM Total:** 25769279488 - **VRAM Free:** 24347803648 - **Torch VRAM Total:** 67108864 - **Torch VRAM Free:** 50200576 ## Logs ``` 2025-07-24T17:17:54.612419 - 2025-07-24T17:17:54.663419 - INFO: IPAdapter model loaded from F:\ComfyUI_Mie_V6.0\ComfyUI\models\ipadapter\ip-adapter-plus_sd15.safetensors2025-07-24T17:17:54.663419 - 2025-07-24T17:17:54.663419 - end_vram - start_vram: 2537542306 - 2537542306 = 02025-07-24T17:17:54.663419 - 2025-07-24T17:17:54.664419 - #11 [IPAdapterUnifiedLoader]: 0.05s - vram 0b2025-07-24T17:17:54.664419 - 2025-07-24T17:17:54.924153 - end_vram - start_vram: 2639727650 - 2537542306 = 1021853442025-07-24T17:17:54.924153 - 2025-07-24T17:17:54.924670 - #10 [IPAdapterAdvanced]: 0.26s - vram 102185344b2025-07-24T17:17:54.924670 - 2025-07-24T17:17:54.931880 - end_vram - start_vram: 2733990564 - 2635766434 = 982241302025-07-24T17:17:54.931880 - 2025-07-24T17:17:54.931880 - #14 [RescaleCFG]: 0.01s - vram 98224130b2025-07-24T17:17:54.931880 - 2025-07-24T17:17:54.933882 - Requested to load BaseModel 2025-07-24T17:17:55.233473 - loaded completely 19197.46322517395 1639.406135559082 True 2025-07-24T17:18:23.076833 - 100%|██████████████████████████████████████████████████████████████████████████████████| 30/30 [00:27<00:00, 1.07it/s]2025-07-24T17:18:23.076833 - 100%|██████████████████████████████████████████████████████████████████████████████████| 30/30 [00:27<00:00, 1.08it/s]2025-07-24T17:18:23.076833 - 2025-07-24T17:18:23.078833 - end_vram - start_vram: 4711053742 - 2733990562 = 19770631802025-07-24T17:18:23.078833 - 2025-07-24T17:18:23.078833 - #3 [KSampler]: 28.15s - vram 1977063180b2025-07-24T17:18:23.078833 - 2025-07-24T17:18:23.711202 - end_vram - start_vram: 8100460554 - 3605411690 = 44950488642025-07-24T17:18:23.711239 - 2025-07-24T17:18:23.711239 - #8 [VAEDecode]: 0.63s - vram 4495048864b2025-07-24T17:18:23.711754 - 2025-07-24T17:18:23.864142 - end_vram - start_vram: 3605411690 - 3605411690 = 02025-07-24T17:18:23.864142 - 2025-07-24T17:18:23.864142 - #15 [SaveImage]: 0.15s - vram 0b2025-07-24T17:18:23.865143 - 2025-07-24T17:18:23.865143 - comfyui lumi batcher overwrite task done2025-07-24T17:18:23.865143 - 2025-07-24T17:18:23.866143 - Prompt executed in 31.05 seconds 2025-07-24T17:18:26.480125 - got prompt 2025-07-24T17:18:53.685302 - 100%|██████████████████████████████████████████████████████████████████████████████████| 30/30 [00:27<00:00, 1.14it/s]2025-07-24T17:18:53.686303 - 100%|██████████████████████████████████████████████████████████████████████████████████| 30/30 [00:27<00:00, 1.11it/s]2025-07-24T17:18:53.686303 - 2025-07-24T17:18:53.686303 - end_vram - start_vram: 4689507218 - 3605411690 = 10840955282025-07-24T17:18:53.686303 - 2025-07-24T17:18:53.687302 - #3 [KSampler]: 27.17s - vram 1084095528b2025-07-24T17:18:53.687302 - 2025-07-24T17:18:54.232028 - end_vram - start_vram: 8100460554 - 3605411690 = 44950488642025-07-24T17:18:54.232028 - 2025-07-24T17:18:54.233027 - #8 [VAEDecode]: 0.54s - vram 4495048864b2025-07-24T17:18:54.233027 - 2025-07-24T17:18:54.380027 - end_vram - start_vram: 3605411690 - 3605411690 = 02025-07-24T17:18:54.380027 - 2025-07-24T17:18:54.380027 - #15 [SaveImage]: 0.15s - vram 0b2025-07-24T17:18:54.380027 - 2025-07-24T17:18:54.381027 - comfyui lumi batcher overwrite task done2025-07-24T17:18:54.382027 - 2025-07-24T17:18:54.385027 - Prompt executed in 27.90 seconds 2025-07-24T17:24:25.352704 - got prompt 2025-07-24T17:24:25.445704 - end_vram - start_vram: 3507187562 - 3507187562 = 02025-07-24T17:24:25.446704 - 2025-07-24T17:24:25.446704 - #20 [LoraLoader]: 0.05s - vram 0b2025-07-24T17:24:25.446704 - 2025-07-24T17:24:25.447704 - Requested to load SD1ClipModel 2025-07-24T17:24:25.792290 - loaded completely 18695.929541397094 235.84423828125 True 2025-07-24T17:24:25.800290 - end_vram - start_vram: 3521486046 - 3507187562 = 142984842025-07-24T17:24:25.800290 - 2025-07-24T17:24:25.800290 - #7 [CLIPTextEncode]: 0.35s - vram 14298484b2025-07-24T17:24:25.800290 - 2025-07-24T17:24:25.808290 - end_vram - start_vram: 3519593078 - 3507187562 = 124055162025-07-24T17:24:25.808290 - 2025-07-24T17:24:25.809290 - #6 [CLIPTextEncode]: 0.01s - vram 12405516b2025-07-24T17:24:25.809290 - 2025-07-24T17:24:25.810290 - end_vram - start_vram: 3507187562 - 3507187562 = 02025-07-24T17:24:25.810290 - 2025-07-24T17:24:25.810290 - #11 [IPAdapterUnifiedLoader]: 0.00s - vram 0b2025-07-24T17:24:25.810290 - 2025-07-24T17:24:26.053290 - end_vram - start_vram: 3609372906 - 3507187562 = 1021853442025-07-24T17:24:26.053290 - 2025-07-24T17:24:26.054290 - #10 [IPAdapterAdvanced]: 0.24s - vram 102185344b2025-07-24T17:24:26.054290 - 2025-07-24T17:24:26.059290 - end_vram - start_vram: 3703635820 - 3605411690 = 982241302025-07-24T17:24:26.059290 - 2025-07-24T17:24:26.060290 - #14 [RescaleCFG]: 0.01s - vram 98224130b2025-07-24T17:24:26.060290 - 2025-07-24T17:24:26.061290 - Requested to load BaseModel 2025-07-24T17:24:26.644908 - loaded completely 19912.1512134552 1639.406135559082 True 2025-07-24T17:24:53.885378 - 100%|██████████████████████████████████████████████████████████████████████████████████| 30/30 [00:27<00:00, 1.08it/s]2025-07-24T17:24:53.885378 - 100%|██████████████████████████████████████████████████████████████████████████████████| 30/30 [00:27<00:00, 1.10it/s]2025-07-24T17:24:53.885378 - 2025-07-24T17:24:53.886378 - end_vram - start_vram: 4689507218 - 3703635818 = 9858714002025-07-24T17:24:53.886378 - 2025-07-24T17:24:53.886378 - #3 [KSampler]: 27.83s - vram 985871400b2025-07-24T17:24:53.887378 - 2025-07-24T17:24:54.482797 - end_vram - start_vram: 8100460554 - 3605411690 = 44950488642025-07-24T17:24:54.482797 - 2025-07-24T17:24:54.482797 - #8 [VAEDecode]: 0.60s - vram 4495048864b2025-07-24T17:24:54.482797 - 2025-07-24T17:24:54.640169 - end_vram - start_vram: 3605411690 - 3605411690 = 02025-07-24T17:24:54.640169 - 2025-07-24T17:24:54.640169 - #15 [SaveImage]: 0.16s - vram 0b2025-07-24T17:24:54.640169 - 2025-07-24T17:24:54.641169 - comfyui lumi batcher overwrite task done2025-07-24T17:24:54.641169 - 2025-07-24T17:24:54.643410 - Prompt executed in 29.28 seconds 2025-07-24T17:25:09.991282 - got prompt 2025-07-24T17:25:10.085282 - end_vram - start_vram: 3507187562 - 3507187562 = 02025-07-24T17:25:10.085282 - 2025-07-24T17:25:10.085282 - #20 [LoraLoader]: 0.05s - vram 0b2025-07-24T17:25:10.085282 - 2025-07-24T17:25:10.086282 - Requested to load SD1ClipModel 2025-07-24T17:25:10.369134 - loaded completely 18695.929541397094 235.84423828125 True 2025-07-24T17:25:10.377134 - end_vram - start_vram: 3521486046 - 3507187562 = 142984842025-07-24T17:25:10.377134 - 2025-07-24T17:25:10.377134 - #7 [CLIPTextEncode]: 0.29s - vram 14298484b2025-07-24T17:25:10.377134 - 2025-07-24T17:25:10.385134 - end_vram - start_vram: 3519593078 - 3507187562 = 124055162025-07-24T17:25:10.385134 - 2025-07-24T17:25:10.385134 - #6 [CLIPTextEncode]: 0.01s - vram 12405516b2025-07-24T17:25:10.385134 - 2025-07-24T17:25:10.386135 - end_vram - start_vram: 3507187562 - 3507187562 = 02025-07-24T17:25:10.386135 - 2025-07-24T17:25:10.386135 - #11 [IPAdapterUnifiedLoader]: 0.00s - vram 0b2025-07-24T17:25:10.386135 - 2025-07-24T17:25:10.631046 - end_vram - start_vram: 3609372906 - 3507187562 = 1021853442025-07-24T17:25:10.631046 - 2025-07-24T17:25:10.631046 - #10 [IPAdapterAdvanced]: 0.24s - vram 102185344b2025-07-24T17:25:10.631046 - 2025-07-24T17:25:10.637046 - end_vram - start_vram: 3703635820 - 3605411690 = 982241302025-07-24T17:25:10.637046 - 2025-07-24T17:25:10.637046 - #14 [RescaleCFG]: 0.01s - vram 98224130b2025-07-24T17:25:10.637046 - 2025-07-24T17:25:10.639047 - Requested to load BaseModel 2025-07-24T17:25:11.180881 - loaded completely 19912.1512134552 1639.406135559082 True 2025-07-24T17:25:39.272121 - 100%|██████████████████████████████████████████████████████████████████████████████████| 30/30 [00:28<00:00, 1.08it/s]2025-07-24T17:25:39.272121 - 100%|██████████████████████████████████████████████████████████████████████████████████| 30/30 [00:28<00:00, 1.07it/s]2025-07-24T17:25:39.272121 - 2025-07-24T17:25:39.273121 - end_vram - start_vram: 4689507218 - 3703635818 = 9858714002025-07-24T17:25:39.273121 - 2025-07-24T17:25:39.274121 - #3 [KSampler]: 28.64s - vram 985871400b2025-07-24T17:25:39.274121 - 2025-07-24T17:25:39.888702 - end_vram - start_vram: 8100460554 - 3605411690 = 44950488642025-07-24T17:25:39.888702 - 2025-07-24T17:25:39.888702 - #8 [VAEDecode]: 0.61s - vram 4495048864b2025-07-24T17:25:39.888702 - 2025-07-24T17:25:40.051703 - end_vram - start_vram: 3605411690 - 3605411690 = 02025-07-24T17:25:40.051703 - 2025-07-24T17:25:40.051703 - #15 [SaveImage]: 0.16s - vram 0b2025-07-24T17:25:40.051703 - 2025-07-24T17:25:40.052703 - comfyui lumi batcher overwrite task done2025-07-24T17:25:40.052703 - 2025-07-24T17:25:40.060703 - Prompt executed in 30.06 seconds 2025-07-24T17:43:56.476860 - got prompt 2025-07-24T17:43:57.039587 - end_vram - start_vram: 106744016 - 106744016 = 02025-07-24T17:43:57.039587 - 2025-07-24T17:43:57.039587 - #7 [WanVideoVAELoader]: 0.48s - vram 0b2025-07-24T17:43:57.040588 - 2025-07-24T17:43:57.040588 - end_vram - start_vram: 106744016 - 106744016 = 02025-07-24T17:43:57.040588 - 2025-07-24T17:43:57.040588 - #12 [WanVideoExperimentalArgs]: 0.00s - vram 0b2025-07-24T17:43:57.040588 - 2025-07-24T17:43:57.041588 - end_vram - start_vram: 106744016 - 106744016 = 02025-07-24T17:43:57.041588 - 2025-07-24T17:43:57.041588 - #10 [WanVideoEnhanceAVideo]: 0.00s - vram 0b2025-07-24T17:43:57.041588 - 2025-07-24T17:43:57.042588 - end_vram - start_vram: 106744016 - 106744016 = 02025-07-24T17:43:57.042588 - 2025-07-24T17:43:57.042588 - #21 [WanVideoVACEModelSelect]: 0.00s - vram 0b2025-07-24T17:43:57.042588 - 2025-07-24T17:44:00.282807 - Detected model in_channels: 36 2025-07-24T17:44:00.282807 - Model type: fl2v, num_heads: 40, num_layers: 40 2025-07-24T17:44:00.283807 - Model variant detected: i2v_720 2025-07-24T17:44:00.596667 - model_type FLOW 2025-07-24T17:44:00.597701 - Using accelerate to load and assign model weights to device... 2025-07-24T17:44:00.801188 - Loading transformer parameters to cpu: 83%|██████████████████████████████▋ | 1080/1304 [00:00<00:00, 5458.86it/s]2025-07-24T17:44:00.839187 - Loading transformer parameters to cpu: 100%|█████████████████████████████████████| 1304/1304 [00:00<00:00, 5446.33it/s]2025-07-24T17:44:00.839187 - 2025-07-24T17:44:00.844187 - end_vram - start_vram: 106744016 - 106744016 = 02025-07-24T17:44:00.844187 - 2025-07-24T17:44:00.844187 - #22 [WanVideoModelLoader]: 3.80s - vram 0b2025-07-24T17:44:00.844187 - 2025-07-24T17:44:02.947231 - end_vram - start_vram: 106744016 - 106744016 = 02025-07-24T17:44:02.948230 - 2025-07-24T17:44:02.948230 - #6 [LoadWanVideoT5TextEncoder]: 2.10s - vram 0b2025-07-24T17:44:02.948230 - 2025-07-24T17:44:02.948230 - Moving video model to cpu 2025-07-24T17:45:21.569551 - end_vram - start_vram: 11728619736 - 106744016 = 116218757202025-07-24T17:45:21.569558 - 2025-07-24T17:45:21.569558 - #8 [WanVideoTextEncode]: 78.62s - vram 11621875720b2025-07-24T17:45:21.569558 - 2025-07-24T17:45:21.624655 - end_vram - start_vram: 115132624 - 115132624 = 02025-07-24T17:45:21.625215 - 2025-07-24T17:45:21.625215 - #34 [LoadImage]: 0.05s - vram 0b2025-07-24T17:45:21.625215 - 2025-07-24T17:45:21.626235 - end_vram - start_vram: 115132624 - 115132624 = 02025-07-24T17:45:21.626242 - 2025-07-24T17:45:21.626242 - #19 [INTConstant]: 0.00s - vram 0b2025-07-24T17:45:21.626242 - 2025-07-24T17:45:21.671234 - end_vram - start_vram: 115132624 - 115132624 = 02025-07-24T17:45:21.671234 - 2025-07-24T17:45:21.671234 - #24 [ImageResizeKJ]: 0.04s - vram 0b2025-07-24T17:45:21.671234 - 2025-07-24T17:45:21.738079 - end_vram - start_vram: 115132624 - 115132624 = 02025-07-24T17:45:21.738592 - 2025-07-24T17:45:21.739108 - #30 [ImageResizeKJ]: 0.07s - vram 0b2025-07-24T17:45:21.739108 - 2025-07-24T17:45:21.782786 - end_vram - start_vram: 115132624 - 115132624 = 02025-07-24T17:45:21.782786 - 2025-07-24T17:45:21.782786 - #35 [ImageResizeKJ]: 0.04s - vram 0b2025-07-24T17:45:21.782786 - 2025-07-24T17:45:21.915384 - end_vram - start_vram: 115132624 - 115132624 = 02025-07-24T17:45:21.915902 - 2025-07-24T17:45:21.915902 - #29 [WanVideoVACEStartToEndFrame]: 0.13s - vram 0b2025-07-24T17:45:21.915902 - 2025-07-24T17:45:21.916414 - end_vram - start_vram: 115132624 - 115132624 = 02025-07-24T17:45:21.916918 - 2025-07-24T17:45:21.917002 - #40 [GetImageRangeFromBatch]: 0.00s - vram 0b2025-07-24T17:45:21.917002 - 2025-07-24T17:45:21.981944 - end_vram - start_vram: 115132624 - 115132624 = 02025-07-24T17:45:21.981944 - 2025-07-24T17:45:21.981944 - #25 [WanVideoVACEStartToEndFrame]: 0.06s - vram 0b2025-07-24T17:45:21.981944 - 2025-07-24T17:45:21.995235 - end_vram - start_vram: 115132624 - 115132624 = 02025-07-24T17:45:21.995235 - 2025-07-24T17:45:21.995235 - #41 [MaskBatchMulti]: 0.01s - vram 0b2025-07-24T17:45:21.995235 - 2025-07-24T17:45:22.039203 - end_vram - start_vram: 115132624 - 115132624 = 02025-07-24T17:45:22.039203 - 2025-07-24T17:45:22.039203 - #37 [ImageBatchMulti]: 0.04s - vram 0b2025-07-24T17:45:22.039708 - 2025-07-24T17:45:22.039713 - end_vram - start_vram: 115132624 - 115132624 = 02025-07-24T17:45:22.040227 - 2025-07-24T17:45:22.040227 - #26 [GetImageSizeAndCount]: 0.00s - vram 0b2025-07-24T17:45:22.040227 - 2025-07-24T17:45:22.883828 - input_masks shape2025-07-24T17:45:22.883828 - 2025-07-24T17:45:22.884341 - torch.Size([81, 496, 896])2025-07-24T17:45:22.884341 - 2025-07-24T17:45:34.863567 - VAE encoding: 100%|██████████████████████████████████████████████████████████████████████| 9/9 [00:11<00:00, 1.30s/it]2025-07-24T17:45:34.863567 - VAE encoding: 100%|██████████████████████████████████████████████████████████████████████| 9/9 [00:11<00:00, 1.32s/it]2025-07-24T17:45:34.864077 - 2025-07-24T17:45:46.589102 - VAE encoding: 100%|██████████████████████████████████████████████████████████████████████| 9/9 [00:11<00:00, 1.30s/it]2025-07-24T17:45:46.589612 - VAE encoding: 100%|██████████████████████████████████████████████████████████████████████| 9/9 [00:11<00:00, 1.30s/it]2025-07-24T17:45:46.589612 - 2025-07-24T17:45:46.600743 - refs shape2025-07-24T17:45:46.600743 - 2025-07-24T17:45:46.600743 - torch.Size([1, 3, 1, 496, 896])2025-07-24T17:45:46.600743 - 2025-07-24T17:45:46.715123 - VAE encoding: 56%|██████████████████████████████████████▉ | 5/9 [00:00<00:00, 44.31it/s]2025-07-24T17:45:46.805051 - VAE encoding: 100%|██████████████████████████████████████████████████████████████████████| 9/9 [00:00<00:00, 44.38it/s]2025-07-24T17:45:46.805583 - 2025-07-24T17:45:46.870662 - end_vram - start_vram: 2252473238 - 115132624 = 21373406142025-07-24T17:45:46.870662 - 2025-07-24T17:45:46.871171 - #16 [WanVideoVACEEncode]: 24.83s - vram 2137340614b2025-07-24T17:45:46.871171 - 2025-07-24T17:45:46.873216 - timesteps: tensor([1000.0000, 983.7124, 964.5367, 941.6301, 913.7864, 879.2166, 835.1485, 777.0445, 696.9283, 579.3684, 390.1099, 34.7826], device='cuda:0') 2025-07-24T17:45:46.887141 - Seq len: 38192 2025-07-24T17:49:31.510530 - Sampling 85 frames at 896x496 with 12 steps 2025-07-24T17:49:37.849674 - 0%| | 0/12 [00:00<?, ?it/s]2025-07-24T17:49:44.296375 - 0%| | 0/12 [00:06<?, ?it/s]2025-07-24T17:49:44.297376 - 2025-07-24T17:49:44.747159 - !!! Exception during processing !!! 'WanModel' object has no attribute 'vace_patch_embedding' 2025-07-24T17:49:44.783076 - Traceback (most recent call last): File "F:\ComfyUI_Mie_V6.0\ComfyUI\execution.py", line 361, 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 "F:\ComfyUI_Mie_V6.0\ComfyUI\execution.py", line 236, 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 "F:\ComfyUI_Mie_V6.0\ComfyUI\execution.py", line 208, in _map_node_over_list process_inputs(input_dict, i) File "F:\ComfyUI_Mie_V6.0\ComfyUI\execution.py", line 197, in process_inputs results.append(getattr(obj, func)(**inputs)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "F:\ComfyUI_Mie_V6.0\ComfyUI\custom_nodes\ComfyUI-WanVideoWrapper\nodes.py", line 3325, in process noise_pred, self.cache_state = predict_with_cfg( ^^^^^^^^^^^^^^^^^ File "F:\ComfyUI_Mie_V6.0\ComfyUI\custom_nodes\ComfyUI-WanVideoWrapper\nodes.py", line 2617, in predict_with_cfg noise_pred_cond, cache_state_cond = transformer( ^^^^^^^^^^^^ File "F:\ComfyUI_Mie_V6.0\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1751, in _wrapped_call_impl return self._call_impl(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "F:\ComfyUI_Mie_V6.0\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1762, in _call_impl return forward_call(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "F:\ComfyUI_Mie_V6.0\ComfyUI\custom_nodes\ComfyUI-WanVideoWrapper\wanvideo\modules\model.py", line 1617, in forward vace_hints = self.forward_vace(x, data["context"], data["seq_len"], kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "F:\ComfyUI_Mie_V6.0\ComfyUI\custom_nodes\ComfyUI-WanVideoWrapper\wanvideo\modules\model.py", line 1196, in forward_vace c = [self.vace_patch_embedding(u.unsqueeze(0).float()).to(x.dtype) for u in vace_context] ^^^^^^^^^^^^^^^^^^^^^^^^^ File "F:\ComfyUI_Mie_V6.0\python_embeded\Lib\site-packages\diffusers\models\modeling_utils.py", line 291, in __getattr__ return super().__getattr__(name) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "F:\ComfyUI_Mie_V6.0\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1940, in __getattr__ raise AttributeError( AttributeError: 'WanModel' object has no attribute 'vace_patch_embedding'. Did you mean: 'patch_embedding'? 2025-07-24T17:49:44.785980 - end_vram - start_vram: 34183609272 - 173795536 = 340098137362025-07-24T17:49:44.785980 - 2025-07-24T17:49:44.785980 - #42 [WanVideoSampler]: 237.91s - vram 34009813736b2025-07-24T17:49:44.785980 - 2025-07-24T17:49:44.798561 - comfyui lumi batcher overwrite task done2025-07-24T17:49:44.798968 - 2025-07-24T17:49:44.868694 - Prompt executed in 348.38 seconds 2025-07-24T18:17:32.104770 - [ComfyUI-Manager] The ComfyRegistry cache update is still in progress, so an outdated cache is being used.2025-07-24T18:17:32.105296 - 2025-07-24T18:17:33.147891 - FETCH DATA from: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/custom-node-list.json2025-07-24T18:17:33.147891 - 2025-07-24T18:17:36.036752 - [DONE]2025-07-24T18:17:36.036752 - 2025-07-24T18:17:36.120191 - FETCH DATA from: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/github-stats.json2025-07-24T18:17:36.120191 - 2025-07-24T18:17:37.292226 - [DONE]2025-07-24T18:17:37.292226 - 2025-07-24T18:17:37.313785 - FETCH DATA from: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/extras.json2025-07-24T18:17:37.313785 - 2025-07-24T18:17:38.420206 - [DONE]2025-07-24T18:17:38.420897 - 2025-07-24T18:17:38.602146 - FETCH DATA from: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/extension-node-map.json2025-07-24T18:17:38.602146 - 2025-07-24T18:17:39.726647 - [DONE]2025-07-24T18:17:39.726647 - 2025-07-24T18:21:32.720524 - got prompt 2025-07-24T18:21:36.403235 - timesteps: tensor([1000.0000, 983.7124, 964.5367, 941.6301, 913.7864, 879.2166, 835.1485, 777.0445, 696.9283, 579.3684, 390.1099, 34.7826], device='cuda:0') 2025-07-24T18:21:36.571239 - Seq len: 38192 2025-07-24T18:21:36.578239 - Sampling 85 frames at 896x496 with 12 steps 2025-07-24T18:21:36.834814 - 0%| | 0/12 [00:00<?, ?it/s]2025-07-24T18:21:40.522225 - 0%| | 0/12 [00:03<?, ?it/s]2025-07-24T18:21:40.522225 - 2025-07-24T18:21:40.567079 - !!! Exception during processing !!! 'WanModel' object has no attribute 'vace_patch_embedding' 2025-07-24T18:21:40.572236 - Traceback (most recent call last): File "F:\ComfyUI_Mie_V6.0\ComfyUI\execution.py", line 361, 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 "F:\ComfyUI_Mie_V6.0\ComfyUI\execution.py", line 236, 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 "F:\ComfyUI_Mie_V6.0\ComfyUI\execution.py", line 208, in _map_node_over_list process_inputs(input_dict, i) File "F:\ComfyUI_Mie_V6.0\ComfyUI\execution.py", line 197, in process_inputs results.append(getattr(obj, func)(**inputs)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "F:\ComfyUI_Mie_V6.0\ComfyUI\custom_nodes\ComfyUI-WanVideoWrapper\nodes.py", line 3325, in process noise_pred, self.cache_state = predict_with_cfg( ^^^^^^^^^^^^^^^^^ File "F:\ComfyUI_Mie_V6.0\ComfyUI\custom_nodes\ComfyUI-WanVideoWrapper\nodes.py", line 2617, in predict_with_cfg noise_pred_cond, cache_state_cond = transformer( ^^^^^^^^^^^^ File "F:\ComfyUI_Mie_V6.0\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1751, in _wrapped_call_impl return self._call_impl(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "F:\ComfyUI_Mie_V6.0\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1762, in _call_impl return forward_call(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "F:\ComfyUI_Mie_V6.0\ComfyUI\custom_nodes\ComfyUI-WanVideoWrapper\wanvideo\modules\model.py", line 1617, in forward vace_hints = self.forward_vace(x, data["context"], data["seq_len"], kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "F:\ComfyUI_Mie_V6.0\ComfyUI\custom_nodes\ComfyUI-WanVideoWrapper\wanvideo\modules\model.py", line 1196, in forward_vace c = [self.vace_patch_embedding(u.unsqueeze(0).float()).to(x.dtype) for u in vace_context] ^^^^^^^^^^^^^^^^^^^^^^^^^ File "F:\ComfyUI_Mie_V6.0\python_embeded\Lib\site-packages\diffusers\models\modeling_utils.py", line 291, in __getattr__ return super().__getattr__(name) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "F:\ComfyUI_Mie_V6.0\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1940, in __getattr__ raise AttributeError( AttributeError: 'WanModel' object has no attribute 'vace_patch_embedding'. Did you mean: 'patch_embedding'? 2025-07-24T18:21:40.574784 - end_vram - start_vram: 34183609272 - 32966353744 = 12172555282025-07-24T18:21:40.574784 - 2025-07-24T18:21:40.575297 - #42 [WanVideoSampler]: 7.68s - vram 1217255528b2025-07-24T18:21:40.575297 - 2025-07-24T18:21:40.575811 - comfyui lumi batcher overwrite task done2025-07-24T18:21:40.575811 - 2025-07-24T18:21:40.577866 - Prompt executed in 7.84 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) 什么问题,该怎么解决
最新发布
07-25
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值