关于验证的时候dropout层的梯度问题
Created by: zq19
出错点:
t recent call last)<ipython-input-8-e2038d08f664> in <module>
1 if __name__ == '__main__':
2 init_log_config()
----> 3 train_val()
<ipython-input-7-a9f48a063fd1> in train_val()
84 loss, acc1 = exe.run(program=val_main_program,(clone自默认主程序)
85 feed=feeder.feed(data),
---> 86 fetch_list=[avg_cost, acc_top1])
出错信息:
C++ Callstacks:
Enforce failed. Expected ctx->Attrs().Get<bool>("is_test") == false, but received ctx->Attrs().Get<bool>("is_test"):1 != false:0.
GradOp is only callable when is_test is false at [/paddle/paddle/fluid/operators/dropout_op.cc:108]
网络dropout层:
block6_dropout = fluid.layers.dropout(x=block5_pool, dropout_prob=0.4)
block6_fc1 = fluid.layers.fc(input=block6_dropout,
size=fc_size,
act='relu')