训练 MiniNet 模型时不兼容的形状

时间:2021-03-24 14:14:15

标签: python tensorflow

我正在尝试使用 MiniNetV2 来训练分段模型,但出现以下错误: InvalidArgumentError: Incompatible shapes: [163840] vs. [40960] [[{{node loss/conv2d_transpose_1_loss/mul}}]]

这是我使用的其余代码:

interface = png_IO( channels=1,classes=1,three_dim=False, im_width=128, im_height=128)
# Create the Data I/O object
data_io = miscnn.Data_IO(interface, data_path,output_path=output_path)
# Create and configure the Data Augmentation class
data_aug = miscnn.Data_Augmentation(cycles=1, scaling=True, rotations=True,
                                    elastic_deform=True, mirror=True,
                                    brightness=True, contrast=True,
                                    gamma=True, gaussian_noise=True)
    # Create and configure the Preprocessor class
pp = miscnn.Preprocessor(data_io, data_aug=data_aug,batch_size=10,analysis="fullimage")

# Import standard U-Net architecture and Soft Dice
from miscnn.neural_network.architecture.unet.MiniNetMiscnn import Architecture




MiniNet = Architecture(n_classes=1, l2=None, is_training=False, upsampling=1)
# Create a deep learning neural network model with a standard U-Net architecturE
model = miscnn.Neural_Network(preprocessor=pp, architecture=MiniNet,
                             metrics=[dice_soft,dice_coefficient],
                            learninig_rate=0.0001,loss=dice_coefficient_loss)#, gpu_number=1)
sample_list = data_io.get_indiceslist() 
cross_validation(sample_list, model, k_fold=5, epochs=200,
                iterations=None, evaluation_path=output_path+"evaluation",
              draw_figures=False, run_detailed_evaluation=False,
              callbacks=[], save_models=True, return_output=False)

有人知道可能是什么问题吗?

0 个答案:

没有答案