yolov5-face
yolov5-face copied to clipboard
Why am I having this problem? AssertionError: No results.txt files found in /content/yolov5-face/runs/train/exp, nothing to plot.
When I run this command:
!python3 train.py --data data/widerface.yaml --cfg models/yolov5s.yaml --weights yolovs-face.pt --epochs 1
I run into this problem.
Traceback (most recent call last):
File "train.py", line 513, in
It seems that the lack of model results makes visualization impossible. Breakpoint debugging is recommended to locate faults.
It seems that the lack of model results makes visualization impossible. Breakpoint debugging is recommended to locate faults.
Yes, you are right. https://github.com/deepcam-cn/yolov5-face/blob/d3505409a6e70f8f878b18686265cf18e04deea6/train.py#L150 This block of code doesn't run because ckpt doesn't have "training_results".
# Results
if ckpt.get('training_results') is not None:
with open(results_file, 'w') as file:
file.write(ckpt['training_results']) # write results.txt
why cases this problem?do you solve it?
I don't know. I still haven't been able to solve it.
I find the problem. If you only use single-GPU and set epoch <20, this block will not work. The solution is to delete epoch>20. I install wandb to view the results. I've run it successfully.
This line of code is on 330 lines of the source code train.py.
# DDP process 0 or single-GPU
if rank in [-1, 0] and epoch > 20:
# mAP
if ema:
ema.update_attr(model, include=['yaml', 'nc', 'hyp', 'gr', 'names', 'stride', 'class_weights'])
final_epoch = epoch + 1 == epochs
if not opt.notest or final_epoch: # Calculate mAP
results, maps, times = test.test(opt.data,
batch_size=total_batch_size,
imgsz=imgsz_test,
model=ema.ema,
single_cls=opt.single_cls,
dataloader=testloader,
save_dir=save_dir,
plots=False,
log_imgs=opt.log_imgs if wandb else 0)
# Write
with open(results_file, 'a') as f:
f.write(s + '%10.4g' * 7 % results + '\n') # P, R, [email protected], [email protected], val_loss(box, obj, cls)
if len(opt.name) and opt.bucket:
os.system('gsutil cp %s gs://%s/results/results%s.txt' % (results_file, opt.bucket, opt.name))
@jijunhao I confirm this is the root cause. Just delete that and epoch>20 if you want to visualize at the very beginning of your training.
I find the problem. If you only use single-GPU and set epoch <20, this block will not work. The solution is to delete epoch>20. I install wandb to view the results. I've run it successfully.
This line of code is on 330 lines of the source code train.py.
# DDP process 0 or single-GPU if rank in [-1, 0] and epoch > 20: # mAP if ema: ema.update_attr(model, include=['yaml', 'nc', 'hyp', 'gr', 'names', 'stride', 'class_weights']) final_epoch = epoch + 1 == epochs if not opt.notest or final_epoch: # Calculate mAP results, maps, times = test.test(opt.data, batch_size=total_batch_size, imgsz=imgsz_test, model=ema.ema, single_cls=opt.single_cls, dataloader=testloader, save_dir=save_dir, plots=False, log_imgs=opt.log_imgs if wandb else 0) # Write with open(results_file, 'a') as f: f.write(s + '%10.4g' * 7 % results + '\n') # P, R, [email protected], [email protected], val_loss(box, obj, cls) if len(opt.name) and opt.bucket: os.system('gsutil cp %s gs://%s/results/results%s.txt' % (results_file, opt.bucket, opt.name))
you are right.thank you
@jijunhao I confirm this is the root cause. Just delete that and epoch>20 if you want to visualize at the very beginning of your training.
thank you