私はcaffe.NetSpec()
関数でネットワークを定義するための赤ちゃんの措置を講じるのですが、私はプログラミングの専門家ではありません。NetSpec()でデコンボリューション層を作成する:SyntaxError
でネットの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
:
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
と 'bias_filler' を追加することにより、それが次のエラーを示した以下になければならない層の定義であります
の2行をコメントアウトした後、このエラーが表示されます。
File "./first_try.py", line 18
param=[dict(lr_mult=1, decay_mult=1), dict(lr_mult=2, decay_mult=0)]])
^
SyntaxError: invalid syntax
誰か助けてもらえますか?あなたはn.fc6 - deconv
に値を代入しようとしているため
どうもありがとう