值错误:gpucorrm映像和内核的堆栈大小必须相同

2024-09-28 19:06:13 发布

您现在位置:Python中文网/ 问答频道 /正文

我的输入数据形状是[n,3,64,64]

我在运行踩踏代码后得到的。在

Using Theano backend.
Using gpu device 0: Tesla K20m (CNMeM is disabled, cuDNN not available)
ValueError: GpuCorrMM images and kernel must have the same stack size

Apply node that caused the error: GpuCorrMM{half, (1, 1)}(GpuContiguous.0, GpuContiguous.0)
Toposort index: 115
Inputs types: [CudaNdarrayType(float32, 4D), CudaNdarrayType(float32, 4D)]
Inputs shapes: [(32, 8, 16, 1024), (256, 512, 5, 5)]
Inputs strides: [(131072, 16384, 1024, 1), (12800, 25, 5, 1)]
Inputs values: ['not shown', 'not shown']
Outputs clients: [[GpuElemwise{Add}[(0, 0)](GpuCorrMM{half, (1, 1)}.0, GpuReshape{4}.0)]]

代码是怎么回事,怎么解决这个问题?谢谢

我的代码:

^{pr2}$

另外,有人知道,有人输入了512个图形,有人知道吗,有人输入了256个图形?我怎样才能解决这个问题?在

谢谢


Tags: the数据代码backend图形nottheanoshown
1条回答
网友
1楼 · 发布于 2024-09-28 19:06:13

当我在cpu上运行这段代码时_模型.摘要()结果是: 0.0 1.0 X轴列车形状-(29404、3、64、64) 29404列车样本


Layer (type)                     Output Shape          Param #     Connected to                     
====================================================================================================
dense_1 (Dense)                  (None, 16384)         1654784     dense_input_1[0][0]              
____________________________________________________________________________________________________
batchnormalization_1 (BatchNorma (None, 16384)         65536       dense_1[0][0]                    
____________________________________________________________________________________________________
activation_1 (Activation)        (None, 16384)         0           batchnormalization_1[0][0]       
____________________________________________________________________________________________________
reshape_1 (Reshape)              (None, 1024, 4, 4)    0           activation_1[0][0]               
____________________________________________________________________________________________________
upsampling2d_1 (UpSampling2D)    (None, 1024, 8, 8)    0           reshape_1[0][0]                  
____________________________________________________________________________________________________
convolution2d_1 (Convolution2D)  (None, 512, 8, 8)     13107712    upsampling2d_1[0][0]             
____________________________________________________________________________________________________
batchnormalization_2 (BatchNorma (None, 512, 8, 8)     32          convolution2d_1[0][0]            
____________________________________________________________________________________________________
activation_2 (Activation)        (None, 512, 8, 8)     0           batchnormalization_2[0][0]       
____________________________________________________________________________________________________
upsampling2d_2 (UpSampling2D)    (None, 512, 16, 16)   0           activation_2[0][0]               
____________________________________________________________________________________________________
convolution2d_2 (Convolution2D)  (None, 256, 16, 16)   3277056     upsampling2d_2[0][0]             
____________________________________________________________________________________________________
batchnormalization_3 (BatchNorma (None, 256, 16, 16)   64          convolution2d_2[0][0]            
____________________________________________________________________________________________________
activation_3 (Activation)        (None, 256, 16, 16)   0           batchnormalization_3[0][0]       
____________________________________________________________________________________________________
upsampling2d_3 (UpSampling2D)    (None, 256, 32, 32)   0           activation_3[0][0]               
____________________________________________________________________________________________________
convolution2d_3 (Convolution2D)  (None, 128, 32, 32)   819328      upsampling2d_3[0][0]             
____________________________________________________________________________________________________
batchnormalization_4 (BatchNorma (None, 128, 32, 32)   128         convolution2d_3[0][0]            
____________________________________________________________________________________________________
activation_4 (Activation)        (None, 128, 32, 32)   0           batchnormalization_4[0][0]       
____________________________________________________________________________________________________
upsampling2d_4 (UpSampling2D)    (None, 128, 64, 64)   0           activation_4[0][0]               
____________________________________________________________________________________________________
convolution2d_4 (Convolution2D)  (None, 64, 64, 64)    204864      upsampling2d_4[0][0]             
____________________________________________________________________________________________________
batchnormalization_5 (BatchNorma (None, 64, 64, 64)    256         convolution2d_4[0][0]            
____________________________________________________________________________________________________
activation_5 (Activation)        (None, 64, 64, 64)    0           batchnormalization_5[0][0]       
____________________________________________________________________________________________________
convolution2d_5 (Convolution2D)  (None, 3, 64, 64)     4803        activation_5[0][0]               
____________________________________________________________________________________________________
activation_6 (Activation)        (None, 3, 64, 64)     0           convolution2d_5[0][0]            
====================================================================================================
Total params: 19,134,563
Trainable params: 19,101,555
Non-trainable params: 33,008
____________________________________________________________________________________________________
____________________________________________________________________________________________________
Layer (type)                     Output Shape          Param #     Connected to                     
====================================================================================================
convolution2d_6 (Convolution2D)  (None, 64, 32, 32)    4864        convolution2d_input_1[0][0]      
____________________________________________________________________________________________________
leakyrelu_1 (LeakyReLU)          (None, 64, 32, 32)    0           convolution2d_6[0][0]            
____________________________________________________________________________________________________
convolution2d_7 (Convolution2D)  (None, 128, 16, 16)   204928      leakyrelu_1[0][0]                
____________________________________________________________________________________________________
leakyrelu_2 (LeakyReLU)          (None, 128, 16, 16)   0           convolution2d_7[0][0]            
____________________________________________________________________________________________________
convolution2d_8 (Convolution2D)  (None, 256, 8, 8)     819456      leakyrelu_2[0][0]                
____________________________________________________________________________________________________
leakyrelu_3 (LeakyReLU)          (None, 256, 8, 8)     0           convolution2d_8[0][0]            
____________________________________________________________________________________________________
convolution2d_9 (Convolution2D)  (None, 512, 4, 4)     3277312     leakyrelu_3[0][0]                
____________________________________________________________________________________________________
leakyrelu_4 (LeakyReLU)          (None, 512, 4, 4)     0           convolution2d_9[0][0]            
____________________________________________________________________________________________________
flatten_1 (Flatten)              (None, 8192)          0           leakyrelu_4[0][0]                
____________________________________________________________________________________________________
dense_2 (Dense)                  (None, 1024)          8389632     flatten_1[0][0]                  
____________________________________________________________________________________________________
leakyrelu_5 (LeakyReLU)          (None, 1024)          0           dense_2[0][0]                    
____________________________________________________________________________________________________
dropout_1 (Dropout)              (None, 1024)          0           leakyrelu_5[0][0]                
____________________________________________________________________________________________________
dense_3 (Dense)                  (None, 2)             2050        dropout_1[0][0]                  
====================================================================================================
Total params: 12,698,242
Trainable params: 12,698,242
Non-trainable params: 0
____________________________________________________________________________________________________
____________________________________________________________________________________________________
Layer (type)                     Output Shape          Param #     Connected to                     
====================================================================================================
input_2 (InputLayer)             (None, 100)           0                                            
____________________________________________________________________________________________________
sequential_1 (Sequential)        (None, 3, 64, 64)     19134563    input_2[0][0]                    
____________________________________________________________________________________________________
sequential_2 (Sequential)        (None, 2)             12698242    sequential_1[1][0]               
====================================================================================================
Total params: 31,832,805
Trainable params: 31,799,797
Non-trainable params: 33,008
____________________________________________________________________________________________________
Pre-training generator...

相关问题 更多 >