2024-10-03 23:20:36 发布
网友
可以在prototxt文件中使用^{}层。 但是,尝试在python中使用它(使用NetSpec()):
NetSpec()
n.resh = L.Reshape(n.fc3, reshape_param={'shape':'{dim:1 dim:1 dim:64 dim:64}'})
我只有错误:
AttributeError: 'BlobShape' object has no attribute 'append'
尝试:
n.resh = L.Reshape(n.fc3, reshape_param={'shape':{'dim': [1, 1, 64, 64]}})
请注意,形状向量[1, 1, 64, 64]是作为列表传递的,而不是像prototxt语法中那样作为字符串传递的。在
[1, 1, 64, 64]
事实上,在使用NetSpec接口时,caffe.proto中定义为repeated的任何条目都应被视为列表/向量。在
caffe.proto
repeated
尝试:
请注意,形状向量
[1, 1, 64, 64]
是作为列表传递的,而不是像prototxt语法中那样作为字符串传递的。在事实上,在使用NetSpec接口时,
caffe.proto
中定义为repeated
的任何条目都应被视为列表/向量。在相关问题 更多 >
编程相关推荐