1
我知道一个人可以(可编程地)使用caffe.Netspec()
设计一个网络,基本上主要目的是写其原型文本。使用caffe.NetSpec()定义网络时,有没有办法从给定的原型文件“附加”?
net = caffe.NetSpec()
.. (define) ..
with open('my_network.prototoxt', 'w') as f:
print(net.to_proto(), file=f)
然而,而不是从头开始,我需要追加根据给prototxt层,让我们说,base.prototxt
。我想要的是类似
net = caffe.NetSpec()
with open('base.prototoxt, 'r') as f:
net.from_proto(file=f) # <== is there something like this?
.. (append) ..
with open('my_network.prototoxt', 'w') as f:
print(net.to_proto(), file=f)
任何人都可以请指教?