thanks a lot but occur another problem like this:
Traceback (most recent call last):
File “”, line 1, in
runfile(’/home/ywr/.config/spyder-py3/云溪/train.py’, wdir=’/home/ywr/.config/spyder-py3/云溪’)
File “/home/ywr/anaconda3/lib/python3.7/site-packages/spyder_kernels/customize/spydercustomize.py”, line 668, in runfile
execfile(filename, namespace)
File “/home/ywr/anaconda3/lib/python3.7/site-packages/spyder_kernels/customize/spydercustomize.py”, line 108, in execfile
exec(compile(f.read(), filename, ‘exec’), namespace)
File “/home/ywr/.config/spyder-py3/云溪/train.py”, line 32, in
features = encoder(img)
File “/home/ywr/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py”, line 489, in  call
result = self.forward(*input, **kwargs)
File “/home/ywr/.config/spyder-py3/云溪/model.py”, line 27, in forward
features = self.linear(features)
File “/home/ywr/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py”, line 489, in  call
result = self.forward(*input, **kwargs)
File “/home/ywr/anaconda3/lib/python3.7/site-packages/torch/nn/modules/linear.py”, line 67, in forward
return F.linear(input, self.weight, self.bias)
File “/home/ywr/anaconda3/lib/python3.7/site-packages/torch/nn/functional.py”, line 1354, in linear
output = input.matmul(weight.t())
RuntimeError: size mismatch, m1: [2048 x 1], m2: [2048 x 1] at /opt/conda/conda-bld/pytorch_1549633347309/work/aten/src/THC/generic/THCTensorMathBlas.cu:266
runfile(’/home/ywr/.config/spyder-py3/云溪/train.py’, wdir=’/home/ywr/.config/spyder-py3/云溪’)
Reloaded modules: model, data_loader
Traceback (most recent call last):
File “”, line 1, in
runfile(’/home/ywr/.config/spyder-py3/云溪/train.py’, wdir=’/home/ywr/.config/spyder-py3/云溪’)
File “/home/ywr/anaconda3/lib/python3.7/site-packages/spyder_kernels/customize/spydercustomize.py”, line 668, in runfile
execfile(filename, namespace)
File “/home/ywr/anaconda3/lib/python3.7/site-packages/spyder_kernels/customize/spydercustomize.py”, line 108, in execfile
exec(compile(f.read(), filename, ‘exec’), namespace)
File “/home/ywr/.config/spyder-py3/云溪/train.py”, line 34, in
character = torch.cat((features, character),1)
RuntimeError: invalid argument 0: Tensors must have same number of dimensions: got 1 and 2 at /opt/conda/conda-bld/pytorch_1549633347309/work/aten/src/THC/generic/THCTensorMath.cu:74