-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
移除Accuracy之后,Fluid怎么使用了? #8942
Comments
新的accuracy接口使用可见示例: Paddle/python/paddle/fluid/tests/book_memory_optimization/test_memopt_image_classification_train.py Line 126 in 87568cf
|
@peterzhang2029 Paddle/python/paddle/fluid/tests/book_memory_optimization/test_memopt_image_classification_train.py Lines 125 to 126 in 87568cf
然后是应该使用 Paddle/python/paddle/fluid/tests/book_memory_optimization/test_memopt_image_classification_train.py Line 149 in 87568cf
代替 accuracy = fluid.layers.Accuracy(input=out, label=label) 吗?测试的如果创建 with fluid.program_guard(inference_program):
test_accuracy = fluid.evaluator.Accuracy(input=out, label=label)
test_target = [avg_cost] + test_accuracy.metrics + test_accuracy.states
inference_program = fluid.io.get_inference_program(test_target) |
batch_size在对每个batch计算的时候能取到当前batch里面样本的个数,而不是手动设置的全局的batch_size, 从而来求平均的准确率,batch_acc就是用来计算当前一个batch的平均acc结果。具体可以在迭代的时候输出结果看一下,如果需要test_accuracy可以参考 https://github.com/JiayiFeng/Paddle/blob/ea508c9ef276192e66ac93b8ea48af2e76385d2d/benchmark/cluster/vgg16/vgg16_fluid.py#L146 |
@peterzhang2029 Paddle/python/paddle/fluid/tests/book_memory_optimization/test_memopt_image_classification_train.py Line 125 in 87568cf
还有优化方法好像没有使用到 Paddle/python/paddle/fluid/tests/book_memory_optimization/test_memopt_image_classification_train.py Lines 122 to 123 in 87568cf
|
@yeyupiaoling 你好,非常抱歉我们在去掉Fluid中的 对models中例子的更新已经开始,估计这两天就可以发出pr。pr merge后,我会在这个issue下回复告知。 再次感谢您对Paddle Fluid的关注,谢谢! |
@JiayiFeng |
非常感谢 @yeyupiaoling 的这些 issue和这些讨论。不仅帮助paddlepaddle团队定位问题,督促我们完善系统,也让日后碰到类似的问题的朋友们可以通过搜索issues内容得到答案。 |
我使用了最新的PaddlePaddle,在使用Fluid的时候发现报错
一步步查看才知道在 #8643 已经去掉了Accuracy,那么https://github.com/PaddlePaddle/models/blob/df8060e7022fcac12fd33a8adf098c0663d8152d/fluid/image_classification/mobilenet.py 这个例子怎办?
比如这些怎么处理
The text was updated successfully, but these errors were encountered: