나는 키보드를 caffe.NetSpec()
함수로 정의하는 단계를 밟고 있으며 프로그래밍에 익숙하지 않습니다.NetSpec()으로 Deconvolution 레이어 만들기 : SyntaxError
나는 NetSpec
에 의해 그물을위한 Deconvolution
층을 창조하는 기능을 정의하고있다. 다음은 계층 정의되어야이다
layer {
name: "deconv1"
type: "Deconvolution"
bottom: "bottom1"
top: "top1"
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 2
decay_mult: 0
}
convolution_param {
num_output: 512
kernel_size: 7
stride: 1
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 0
}
}
}
이 함수 정의이다
File "./first_try.py", line 78
n.fc6-deconv=deconv_relu(n.fc7,512,ks=7)
SyntaxError: can't assign to operator
: 그것은 다음과 같은 오류를 도시 한
weight_filler
와 'bias_filler'를 가산함으로써
def deconv_relu(bottom,nout,ks=3,stride=1,pad=1,std=0.01):
deconv=L.Deconvolution(bottom,
convolution_param=[dict(num_output=nout, kernel_size=ks, stride=stride, pad=pad),
param=[dict(lr_mult=1, decay_mult=1), dict(lr_mult=2, decay_mult=0)]])
## weight_filler=dict(type= 'gaussian', std=std),
## bias_filler=dict(type= 'constant',value=0))
return deconv
두 줄을 주석으로 처리 한 결과이 오류가 표시됩니다.
File "./first_try.py", line 18
param=[dict(lr_mult=1, decay_mult=1), dict(lr_mult=2, decay_mult=0)]])
^
SyntaxError: invalid syntax
누군가 도와 드릴 수 있습니까?
덕분에 많은