{"action":"created","issue":{"url":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/19343","repository_url":"https://api.github.com/repos/PaddlePaddle/Paddle","labels_url":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/19343/labels{/name}","comments_url":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/19343/comments","events_url":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/19343/events","html_url":"https://github.com/PaddlePaddle/Paddle/issues/19343","id":483752611,"node_id":"MDU6SXNzdWU0ODM3NTI2MTE=","number":19343,"title":"How to get 'feeded_var_names' and 'target_vars' so that I can save the inference model?","user":{"login":"prakharg24","id":20368770,"node_id":"MDQ6VXNlcjIwMzY4Nzcw","avatar_url":"https://avatars1.githubusercontent.com/u/20368770?v=4","gravatar_id":"","url":"https://api.github.com/users/prakharg24","html_url":"https://github.com/prakharg24","followers_url":"https://api.github.com/users/prakharg24/followers","following_url":"https://api.github.com/users/prakharg24/following{/other_user}","gists_url":"https://api.github.com/users/prakharg24/gists{/gist_id}","starred_url":"https://api.github.com/users/prakharg24/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prakharg24/subscriptions","organizations_url":"https://api.github.com/users/prakharg24/orgs","repos_url":"https://api.github.com/users/prakharg24/repos","events_url":"https://api.github.com/users/prakharg24/events{/privacy}","received_events_url":"https://api.github.com/users/prakharg24/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2019-08-22T03:41:15Z","updated_at":"2019-08-29T02:24:59Z","closed_at":"2019-08-29T02:24:59Z","author_association":"NONE","body":"I am new to paddlepaddle. I am trying to reproduce the code present here ->\r\n\r\nhttps://github.com/PaddlePaddle/models/blob/develop/PaddleCV/ssd/train.py\r\n\r\nBut instead of using save_persistables, I want to do save_inference_model\r\n\r\nHowever save_inference_model requires two extra inputs, 'feeded_var_names' and 'target_vars'. From where can I get this input?\r\n\r\nIn short, how do I edit the code present in train.py in the repository above, so that I can use save_inference_model instead of save_persistables? (line 225)\r\n\r\nThank You.\r\n"},"comment":{"url":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/comments/525994386","html_url":"https://github.com/PaddlePaddle/Paddle/issues/19343#issuecomment-525994386","issue_url":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/19343","id":525994386,"node_id":"MDEyOklzc3VlQ29tbWVudDUyNTk5NDM4Ng==","user":{"login":"prakharg24","id":20368770,"node_id":"MDQ6VXNlcjIwMzY4Nzcw","avatar_url":"https://avatars1.githubusercontent.com/u/20368770?v=4","gravatar_id":"","url":"https://api.github.com/users/prakharg24","html_url":"https://github.com/prakharg24","followers_url":"https://api.github.com/users/prakharg24/followers","following_url":"https://api.github.com/users/prakharg24/following{/other_user}","gists_url":"https://api.github.com/users/prakharg24/gists{/gist_id}","starred_url":"https://api.github.com/users/prakharg24/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prakharg24/subscriptions","organizations_url":"https://api.github.com/users/prakharg24/orgs","repos_url":"https://api.github.com/users/prakharg24/repos","events_url":"https://api.github.com/users/prakharg24/events{/privacy}","received_events_url":"https://api.github.com/users/prakharg24/received_events","type":"User","site_admin":false},"created_at":"2019-08-29T02:24:59Z","updated_at":"2019-08-29T02:24:59Z","author_association":"NONE","body":"Reopened this in case anyone visits this issue for reference. Feeding [locs, confs] as target_vars will not work.\r\n\r\nlocs -> represent the distortion from the anchor box.\r\nconfs -> represent the confidence score (without softmax)\r\nbox -> represent anchor boxes\r\nbox_var -> represent anchor box variance\r\n\r\n'fluid.layers.detection_output' actually does two things. One it converts the above four variable into confidence score and predicted boxes (which is what we actually want). And two it applies NMS on them.\r\n\r\nSo, this code is the final version that works properly\r\n\r\n```\r\nlocs, confs, box, box_var = build_mobilenet_ssd(image, class_num, image_shape)\r\n\r\ndecoded_box = fluid.layers.box_coder(prior_box=box, prior_box_var=box_var, target_box=locs, code_type='decode_center_size')\r\nconf_inf = fluid.layers.softmax(input=confs)\r\nconf_inf = fluid.layers.transpose(conf_inf, perm=[0, 2, 1])\r\n```\r\n\r\nNow feed [decoded_box, conf_inf] as target_vars for saving the final inference model."}}
{"actor":{"display_login":"prakharg24"}}