centos保存模型错误,mac与centos 模型结构保存行为不一致,
Created by: oshixiaoxiliu
使用以下代码保存模型结构,在centos、macos上行为不一致,centos上保存的结构错误
` import os import math import paddle import paddle.fluid as fluid import sys import time use_cuda = False
def fake_model(): fc_input = fluid.layers.data(name="fc_input", shape=[-1, 950], dtype='float32') fc0 = fluid.layers.fc(input=fc_input, size=256, act="tanh") fc1 = fluid.layers.fc(input=fc0, size=128, act="tanh") return fc_input, fc1
def fake_train(): model_dir = "./fake_train__model" fc_input, fc1 = fake_model() place = fluid.CPUPlace() exe = fluid.Executor(place) exe.run(fluid.default_startup_program()) fluid.io.save_inference_model(model_dir, [fc_input.name], [fc1], exe)
if name == 'main': fake_train() `
centos上的保存出的结构如下,缺少了一个tanh激活函数,期望是有一个tanh激活函数的
环境如下 paddle版本 1.3.2 python版本 mac上为 Python 2.7.10 centos为Python 2.7.10