I know that one can (programmably) design a network using caffe.Netspec()
, and basically the main purpose is to write its prototxt.
net = caffe.NetSpec()
.. (define) ..
with open('my_network.prototoxt', 'w') as f:
print(net.to_proto(), file=f)
However, instead of starting from scratch, I need to append layers based on a given prototxt, let's say, base.prototxt
. What I want is something like
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)
Could anyone please advise?