GAN就是这样的 例 期望输入为(batch_size,channels,64,64),但您的数据为(64,3,128,128)。所以你得到一个形状不匹配,因为鉴别器的输出是25而不是1。
print( mx.visualization.print_summary(discriminatorSymbol, shape={'data':(64,3,128,128)})) gives Layer (type) Output Shape Param # Previous Layer ======================================================================================================================== data(null) 3x128x128 0 ________________________________________________________________________________________________________________________ d1(Convolution) 128x64x64 6144 data ________________________________________________________________________________________________________________________ dact1(LeakyReLU) 128x64x64 0 d1 ________________________________________________________________________________________________________________________ d2(Convolution) 256x32x32 524288 dact1 ________________________________________________________________________________________________________________________ dbn2(BatchNorm) 256x32x32 512 d2 ________________________________________________________________________________________________________________________ dact2(LeakyReLU) 256x32x32 0 dbn2 ________________________________________________________________________________________________________________________ d3(Convolution) 512x16x16 2097152 dact2 ________________________________________________________________________________________________________________________ dbn3(BatchNorm) 512x16x16 1024 d3 ________________________________________________________________________________________________________________________ dact3(LeakyReLU) 512x16x16 0 dbn3 ________________________________________________________________________________________________________________________ d4(Convolution) 1024x8x8 8388608 dact3 ________________________________________________________________________________________________________________________ dbn4(BatchNorm) 1024x8x8 2048 d4 ________________________________________________________________________________________________________________________ dact4(LeakyReLU) 1024x8x8 0 dbn4 ________________________________________________________________________________________________________________________ d5(Convolution) 1x5x5 16384 dact4 ________________________________________________________________________________________________________________________ flatten0(Flatten) 25 0 d5