Paddle icon indicating copy to clipboard operation
Paddle copied to clipboard

fluid.io.save_inference_model The target variable must have an associated operator that generates it.

Open lyp2github opened this issue 8 years ago • 2 comments

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.

lyp2github avatar Nov 02 '18 04:11 lyp2github

Hi, Could you take a look at this issue? @Superjomn @Xreki Thanks!

dzhwinter avatar Nov 28 '18 08:11 dzhwinter

Since you haven't replied for more than a year, we have closed this issue/pr. If the problem is not solved or there is a follow-up one, please reopen it at any time and we will continue to follow up. 由于您超过一年未回复,我们将关闭这个issue/pr。 若问题未解决或有后续问题,请随时重新打开,我们会继续跟进。

paddle-bot-old avatar May 22 '20 10:05 paddle-bot-old