fluid.io.save_inference_model The target variable must have an associated operator that generates it.
Created by: lyp2github
cost, prediction = network.rank_model()
left_score = fluid.layers.fc(input=fc_pos_hid1, size=1, act="sigmoid", param_attr=hid_para_attr, bias_attr=hid_bias_attr)
# The cosine similarity score of source and right target.
fc_neg_hid1 = fluid.layers.concat(input=[fc_img] +fc_hid0[5:8], axis=1)
right_score = fluid.layers.fc(input=fc_neg_hid1, size=1, act="sigmoid", param_attr=hid_para_attr, bias_attr=hid_bias_attr)
cost = fluid.layers.rank_loss(label, left_score, right_score)
# but this operator is not supported currently.
# so AUC will not used.
return cost, left_score
fluid.io.save_inference_model(save_dirname, [var.name for var in modelvars[0:5]], [prediction], train_exe)
Traceback (most recent call last): File "train_fc.py", line 216, in train(is_local=True) File "train_fc.py", line 190, in train train_loop(fluid.default_main_program()) File "train_fc.py", line 164, in train_loop [prediction], train_exe) File "/home/work/liuyaping/paddle/paddle_release_home/python/lib/python2.7/site-packages/paddle/fluid/io.py", line 649, in save_inference_model main_program = main_program._prune(targets=target_vars) File "/home/work/liuyaping/paddle/paddle_release_home/python/lib/python2.7/site-packages/paddle/fluid/framework.py", line 1739, in _prune "The target variable must have an " ValueError: The target variable must have an associated operator that generates it.