WongKinYiu / PyTorch_YOLOv4

PyTorch implementation of YOLOv4

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

I had " ValueError: too many values to unpack (expected 2) " error

Anthony1011 opened this issue · comments

Hi everyone when I run train.py, I got the error as below, those message including which hyper parameter be used.

Namespace(adam=False, batch_size=1, bucket='', cache_images=False, cfg='cfg/yolov4.cfg', data='data/coco.yaml', device='', epochs=5, evolve=False, exist_ok=False, global_rank=-1, hyp='data/hyp.scratch.yaml', image_weights=False, img_size=[640, 640], local_rank=-1, log_imgs=16, multi_scale=False, name='exp', noautoanchor=False, nosave=False, notest=False, project='runs/train', rect=False, resume=False, save_dir='runs/train/exp2', single_cls=False, sync_bn=False, total_batch_size=1, weights='weights/yolov4_org.pt', workers=8, world_size=1)
Start Tensorboard with "tensorboard --logdir runs/train", view at http://localhost:6006/
Hyperparameters {'lr0': 0.01, 'lrf': 0.1, 'momentum': 0.9, 'weight_decay': 5e-06, 'warmup_epochs': 3.0, 'warmup_momentum': 0.8, 'warmup_bias_lr': 0.1, 'box': 0.05, 'cls': 0.3, 'cls_pw': 1.0, 'obj': 0.6, 'obj_pw': 1.0, 'iou_t': 0.2, 'anchor_t': 4.0, 'fl_gamma': 0.0, 'hsv_h': 0.015, 'hsv_s': 0.7, 'hsv_v': 0.4, 'degrees': 0.0, 'translate': 0.1, 'scale': 0.9, 'shear': 0.0, 'perspective': 0.0, 'flipud': 0.0, 'fliplr': 0.5, 'mosaic': 1.0, 'mixup': 0.0}
Traceback (most recent call last):
File "/Users/anthony/PyTorch_YOLOv4/train.py", line 540, in
train(hyp, opt, device, tb_writer, wandb)
File "/Users/anthony/PyTorch_YOLOv4/train.py", line 84, in train
model = Darknet(opt.cfg).to(device) # create
File "/Users/anthony/PyTorch_YOLOv4/models/models.py", line 451, in init
self.module_defs = parse_model_cfg(cfg)
File "/Users/anthony/PyTorch_YOLOv4/utils/parse_config.py", line 26, in parse_model_cfg
key, val = line.split("=")
ValueError: too many values to unpack (expected2)

And I check the path there is no space, hope someone would give me so suggestions, appreciation.

I'm trying to work towards a problem considering cfg.files
我認為可能是我使用的config有太多參數不符合架構,我仍在嘗試中。

And I get the information

截圖 2022-06-16 下午9 11 49

hi everyone I got the solution for this problem.
It is about I do some #marks in configure, so it read #marks as values....
I share this experience and hope you don't laugh at me.
Good night.