deepinsight / deepinsight/insightface
arc_face训练时出现维度不一致的错误
- Dominant language
- Python
- Stars
- 29.7k
- Forks
- 6.1k
- PR merge metrics
- No merged PRs in 30d
Description
我使用了自己的图片数据集做成了bin文件,label.txt 也是按照您给的格式,agedb_30.bin,cfp_fp.bin,lfw.bin是下载的MS1M_bin数据里自带的。cpu,paddle2.1.1,Ubuntu 18.04 LTS训练时出现以下错误,batch_size 给定为1,希望能够解答,非常感谢。
EPS = np.finfo(np.float).eps
finish reading file, image num: 100
softmax weight init successfully!
softmax weight mom init successfully!
Epoch 0: LambdaDecay set learning rate to 0.1.
Epoch 0: LinearWarmup set learning rate to 0.0.
Epoch 0: LambdaDecay set learning rate to 0.1.
Epoch 0: LinearWarmup set learning rate to 0.0.
Total Step is: 3200
loading bin 0
loading bin 1000
loading bin 2000
loading bin 3000
loading bin 4000
loading bin 5000
loading bin 6000
loading bin 7000
loading bin 8000
loading bin 9000
loading bin 10000
loading bin 11000
(12000, 3, 112, 112)
loading bin 0
loading bin 1000
loading bin 2000
loading bin 3000
loading bin 4000
loading bin 5000
loading bin 6000
loading bin 7000
loading bin 8000
loading bin 9000
loading bin 10000
loading bin 11000
loading bin 12000
loading bin 13000
(14000, 3, 112, 112)
loading bin 0
loading bin 1000
loading bin 2000
loading bin 3000
loading bin 4000
loading bin 5000
loading bin 6000
loading bin 7000
loading bin 8000
loading bin 9000
loading bin 10000
loading bin 11000
(12000, 3, 112, 112)
/root/miniconda3/lib/python3.8/site-packages/paddle/tensor/creation.py:125: DeprecationWarning: `np.object` is a deprecated alias for the builtin `object`. To silence this warning, use `object` by itself. Doing this will not modify any behavior and is safe.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
if data.dtype == np.object:
/root/miniconda3/lib/python3.8/site-packages/paddle/nn/layer/norm.py:640: UserWarning: When training, we now always track global mean and variance.
warnings.warn(
Traceback (most recent call last):
File "train.py", line 156, in
main(args)
File "train.py", line 105, in main
x_grad, loss_v = module_partial_fc.forward_backward(
File "/insightface-master/insightface-master (2)/insightface-master/recognition/arcface_paddle/partial_fc.py", line 136, in forward_backward
logits = self.forward(total_features, norm_weight)
File "/insightface-master/insightface-master (2)/insightface-master/recognition/arcface_paddle/partial_fc.py", line 115, in forward
logits = linear(total_features, paddle.t(norm_weight))
File "/root/miniconda3/lib/python3.8/site-packages/paddle/nn/functional/common.py", line 1450, in linear
core.ops.matmul(x, weight, pre_bias, 'transpose_X', False,
ValueError: (InvalidArgument) The fisrt matrix width should be same as second matrix height,but received fisrt matrix width 104448, second matrix height 128
[Hint: Expected dim_a.width_ == dim_b.height_, but received dim_a.width_:104448 != dim_b.height_:128.] (at /paddle/paddle/fluid/operators/math/blas_impl.h:1201)
[operator < matmul > error]
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at train.py line 105 and trace module_partial_fc.forward_backward into recognition/arcface_paddle/partial_fc.py lines 115 and 136. Compare the feature shape reaching linear with norm_weight's shape, then reproduce using the reported batch size and dataset; done means training proceeds without the 104448-versus-128 matrix-dimension error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100