我试图在python中计算我自己的训练循环中的测试损失。调用solver.test_nets[0].forward()似乎更新了score blob,但没有更新loss blob。知道怎么更新吗?
我使用以下解决程序配置:
net: "/tmp/tmp8ikb9sg2/train.prototxt"
test_net: "/tmp/tmp8ikb9sg2/test.prototxt"
test_iter: 1
test_interval: 2147483647
base_lr: 0.1
lr_policy: "fixed"
test_initialization: false除了文件顶部的阶段定义外,train和test.prototxt完全相同:
name: "pycaffenet"
state {
phase: TRAIN # set TEST in test.prototxt
}
...
layer {
name: "loss"
type: "SoftmaxWithLoss"
bottom: "score"
bottom: "output"
top: "loss"
}发布于 2016-08-01 10:27:55
其实是另一个问题,我的想法。loss blob正在更新,但由于solver.test_nets[0]的权重没有变化,所以它保持不变。看起来它们不会自动与solver.net共享。这可以通过简单地调用:
solver.test_nets[0].share_with(solver.net)https://stackoverflow.com/questions/38511503
复制相似问题