Reputation: 128
It is possible to use "Reshape"
layer within a prototxt file.
However, trying to use it in python (using NetSpec()
):
n.resh = L.Reshape(n.fc3, reshape_param={'shape':'{dim:1 dim:1 dim:64 dim:64}'})
I got nothing but error:
AttributeError: 'BlobShape' object has no attribute 'append'
Upvotes: 1
Views: 1999
Reputation: 114866
Try:
n.resh = L.Reshape(n.fc3, reshape_param={'shape':{'dim': [1, 1, 64, 64]}})
Note that the shape vector [1, 1, 64, 64]
is passed as a list and not as a string like in the prototxt syntax.
In fact, any entry defined as repeated
in caffe.proto
, should be considered as a list/vector when interfacing using NetSpec.
Upvotes: 3