kuaikuaikim / dface

Deep learning face detection and recognition, implemented by pytorch. (pytorch实现的人脸检测和人脸识别)
http://dface.tech
Apache License 2.0
1.24k stars 348 forks source link

Runtime error:zero-dimensional tensor(at position 0) cannot be contatenated #27

Open Llq201809 opened 5 years ago

Llq201809 commented 5 years ago

when I run train_p_net.py ,it shows these error: Traceback (most recent call last): File "dface/train_net/train_p_net.py", line 50, in end_epoch=args.end_epoch, frequent=args.frequent, lr=args.lr, batch_size=args.batch_size, use_cuda=args.use_cuda) File "dface/train_net/train_p_net.py", line 17, in train_net train_pnet(model_store_path=model_store_path, end_epoch=end_epoch, imdb=gt_imdb, batch_size=batch_size, frequent=frequent, base_lr=lr, use_cuda=use_cuda) File "/home/li/DFace/dface/train_net/train.py", line 97, in train_pnet accuracy_avg = torch.mean(torch.cat(accuracy_list)) RuntimeError: zero-dimensional tensor (at position 0) cannot be concatenated

Dawnlnz commented 5 years ago

Hello, I have the same problem.Have you saved it?

Dawnlnz commented 5 years ago

Thank,I have solved it.

markson14 commented 5 years ago

change the error line into accuracy_avg = torch.mean(torch.stack(accuracy_list, dim=0))