Paddle icon indicating copy to clipboard operation
Paddle copied to clipboard

关于fleet.save_inference_model的警告

Open starsblinking opened this issue 6 years ago • 5 comments

其实也就是paddle.fluid.io.save_inference_model的警告。 请问为什么会报"please ensure that you have set the auc states to zeros before saving inference model"呢?有点困惑 请问是否有“set the auc states to zeros”的demo呢?

拿https://github.com/PaddlePaddle/Paddle/blob/v1.8.3/python/paddle/fluid/tests/unittests/test_inference_model_io.py 里的test_save_inference_model_with_auc 举例来说: 是因为auc定义的layer会影响到该layer的输入(predict和y),进而影响到也使用了同样输入的cost吗?如果这里面有什么坑,为啥不在这个test_case里直接把跳过该坑的方式写出来呢。

   1)PaddlePaddle版本:1.8.3

starsblinking avatar Aug 24 '20 08:08 starsblinking

应该是auc会记录一些统计信息,比如正确和错误的个数,这些会存下来,如果你用这个inference model再去跑auc统计,数值会继续累加。

willthefrog avatar Aug 24 '20 10:08 willthefrog

auc layer的输出是的最后一个list就是这些状态,见 这里, save的时候可以考虑不保存这些,或者assign为0。

willthefrog avatar Aug 24 '20 10:08 willthefrog

应该是auc会记录一些统计信息,比如正确和错误的个数,这些会存下来,如果你用这个inference model再去跑auc统计,数值会继续累加。

噢噢,明白了。那其实我保存的时候不清零这些state,而是在载入model之后先清零这些state再做inference以及统计auc,也是可以的吧~

starsblinking avatar Aug 24 '20 11:08 starsblinking

可以的,但是inference model估计不太好修改赋值。

willthefrog avatar Aug 24 '20 14:08 willthefrog

多谢

starsblinking avatar Aug 28 '20 11:08 starsblinking