failed to load trained network in one file using fluid.io.load_persistables
Created by: walloollaw
i failed to load a model in one file which was generated by code like this:
fluid.io.save_persistables(exe, model_path, filename='params.model')
...
fluid.io.load_persistables(exe, model_path, filename='params.model')
but i can load the same trained model whose params saved in multiple files:
fluid.io.save_persistables(exe, model_path)
...
fluid.io.load_persistables(exe, model_path)
- the log for failed case:
I0802 16:28:24.895386 12316 scope.cc:129] Create variable batch_norm_6.tmp_1
I0802 16:28:24.895393 12316 executor.cc:113] Create Variable batch_norm_6.tmp_1 locally, which pointer is 0x7f6c0e8eece0
I0802 16:28:24.896050 12316 executor.cc:335] CUDAPlace(0) Op(feed), inputs:{X[feed[-1]({{}})]}, outputs:{Out[label[0]({})]}.
I0802 16:28:24.896121 12316 feed_op.cc:51] Feed Var feed's 1 column to var label
I0802 16:28:24.896163 12316 executor.cc:340] CUDAPlace(0) Op(feed), inputs:{X[feed[-1]({{}})]}, outputs:{Out[label[512, 1]({})]}.
I0802 16:28:24.896180 12316 executor.cc:335] CUDAPlace(0) Op(feed), inputs:{X[feed[-1]({{}})]}, outputs:{Out[image[0]({})]}.
I0802 16:28:24.896193 12316 feed_op.cc:51] Feed Var feed's 0 column to var image
I0802 16:28:24.896211 12316 executor.cc:340] CUDAPlace(0) Op(feed), inputs:{X[feed[-1]({{}})]}, outputs:{Out[image[512, 3, 32, 32]({})]}.
I0802 16:28:24.896229 12316 executor.cc:335] CUDAPlace(0) Op(conv2d), inputs:{Filter[conv2d_0.w_0[1]({})], Input[image[512, 3, 32, 32]({})]}, outputs:{Output[conv2d_0.tmp_0[0]({})]}.
- the log for normal case:
I0802 16:29:00.734550 13629 scope.cc:129] Create variable batch_norm_6.tmp_1
I0802 16:29:00.734557 13629 executor.cc:113] Create Variable batch_norm_6.tmp_1 locally, which pointer is 0x7f61f42a3660
I0802 16:29:00.734583 13629 executor.cc:335] CUDAPlace(0) Op(feed), inputs:{X[feed[-1]({{}})]}, outputs:{Out[label[0]({})]}.
I0802 16:29:00.734608 13629 feed_op.cc:51] Feed Var feed's 1 column to var label
I0802 16:29:00.734633 13629 executor.cc:340] CUDAPlace(0) Op(feed), inputs:{X[feed[-1]({{}})]}, outputs:{Out[label[512, 1]({})]}.
I0802 16:29:00.734647 13629 executor.cc:335] CUDAPlace(0) Op(feed), inputs:{X[feed[-1]({{}})]}, outputs:{Out[image[0]({})]}.
I0802 16:29:00.734659 13629 feed_op.cc:51] Feed Var feed's 0 column to var image
I0802 16:29:00.734680 13629 executor.cc:340] CUDAPlace(0) Op(feed), inputs:{X[feed[-1]({{}})]}, outputs:{Out[image[512, 3, 32, 32]({})]}.
I0802 16:29:00.734695 13629 executor.cc:335] CUDAPlace(0) Op(conv2d), inputs:{Filter[conv2d_0.w_0[16, 3, 3, 3]({})], Input[image[512, 3, 32, 32]({})]}, outputs:{Output[conv2d_0.tmp_0[0]({})]}.
I0802 16:29:00.734752 13629 operator.cc:635] expected_kernel_key:data_type[float]:data_layout[ANY_LAYOUT]:place[CUDAPlace(0)]:library_type[CUDNN]
I0802 16:29:00.735915 13629 executor.cc:340] CUDAPlace(0) Op(conv2d), inputs:{Filter[conv2d_0.w_0[16, 3, 3, 3]({})], Input[image[512, 3, 32, 32]({})]}, outputs:{Output[conv2d_0.tmp_0[512, 16, 32, 32]({})]}.
I0802 16:29:00.735952 13629 executor.cc:335] CUDAPlace(0) Op(batch_norm), inputs:{Bias[batch_norm_0.b_0[16]({})], Mean[batch_norm_0.w_1[16]({})], Scale[batch_norm_0.w_0[16]({})], Variance[batch_norm_0.w_2[16]({})], X[conv2d_0.tmp_0[512, 16, 32, 32]({})]}, outputs:{MeanOut[batch_norm_0.w_1[16]({})], SavedMean[batch_norm_0.tmp_0[0]({})], SavedVariance[batch_norm_0.tmp_1[0]({})], VarianceOut[batch_norm_0.w_2[16]({})], Y[batch_norm_0.tmp_2[0]({})]}.