1.需要加上如下设置,否则转换前后输出可能不一致,这个主要针对dropout.BN层训练测试不一致 from keras import backend as K K.set_learning_phase(0) # 0 testing, 1 training mode 2.outputs而非output,否则会导致转换后无法 batch inference def h5_to_pb(h5_model, output_dir, model_name, out_prefix="output_"…