Yolox 3.0 不能正常运行 求解
训练集用的是VOC的
2022-08-20 16:20:32.726 | INFO | yolox.core.trainer:before_train:130 - args: Namespace(batch_size=64, cache=False, ckpt='yolox_s.pth', devices=0, dist_backend='nccl', dist_url=None, exp_file='exps/example/yolox_voc/yolox_voc_s.py', experiment_name='yolox_voc_s', fp16=False, logger='tensorboard', machine_rank=0, name=None, num_machines=1, occupy=False, opts=[], resume=False, start_epoch=None)
2022-08-20 16:20:32.728 | INFO | yolox.core.trainer:before_train:131 - exp value:
╒═══════════════════╤════════════════════════════╕
│ keys │ values │
╞═══════════════════╪════════════════════════════╡
│ seed │ None │
├───────────────────┼────────────────────────────┤
│ output_dir │ './YOLOX_outputs' │
├───────────────────┼────────────────────────────┤
│ print_interval │ 5 │
├───────────────────┼────────────────────────────┤
│ eval_interval │ 5 │
├───────────────────┼────────────────────────────┤
│ num_classes │ 2 │
├───────────────────┼────────────────────────────┤
│ depth │ 0.33 │
├───────────────────┼────────────────────────────┤
│ width │ 0.5 │
├───────────────────┼────────────────────────────┤
│ act │ 'silu' │
├───────────────────┼────────────────────────────┤
│ data_num_workers │ 4 │
├───────────────────┼────────────────────────────┤
│ input_size │ (640, 640) │
├───────────────────┼────────────────────────────┤
│ multiscale_range │ 5 │
├───────────────────┼────────────────────────────┤
│ data_dir │ None │
├───────────────────┼────────────────────────────┤
│ train_ann │ 'instances_train2017.json' │
├───────────────────┼────────────────────────────┤
│ val_ann │ 'instances_val2017.json' │
├───────────────────┼────────────────────────────┤
│ test_ann │ 'instances_test2017.json' │
├───────────────────┼────────────────────────────┤
│ mosaic_prob │ 1.0 │
├───────────────────┼────────────────────────────┤
│ mixup_prob │ 1.0 │
├───────────────────┼────────────────────────────┤
│ hsv_prob │ 1.0 │
├───────────────────┼────────────────────────────┤
│ flip_prob │ 0.5 │
├───────────────────┼────────────────────────────┤
│ degrees │ 10.0 │
├───────────────────┼────────────────────────────┤
│ translate │ 0.1 │
├───────────────────┼────────────────────────────┤
│ mosaic_scale │ (0.1, 2) │
├───────────────────┼────────────────────────────┤
│ enable_mixup │ True │
├───────────────────┼────────────────────────────┤
│ mixup_scale │ (0.5, 1.5) │
├───────────────────┼────────────────────────────┤
│ shear │ 2.0 │
├───────────────────┼────────────────────────────┤
│ warmup_epochs │ 1 │
├───────────────────┼────────────────────────────┤
│ max_epoch │ 300 │
├───────────────────┼────────────────────────────┤
│ warmup_lr │ 0 │
├───────────────────┼────────────────────────────┤
│ min_lr_ratio │ 0.05 │
├───────────────────┼────────────────────────────┤
│ basic_lr_per_img │ 0.00015625 │
├───────────────────┼────────────────────────────┤
│ scheduler │ 'yoloxwarmcos' │
├───────────────────┼────────────────────────────┤
│ no_aug_epochs │ 15 │
├───────────────────┼────────────────────────────┤
│ ema │ True │
├───────────────────┼────────────────────────────┤
│ weight_decay │ 0.0005 │
├───────────────────┼────────────────────────────┤
│ momentum │ 0.9 │
├───────────────────┼────────────────────────────┤
│ save_history_ckpt │ True │
├───────────────────┼────────────────────────────┤
│ exp_name │ 'yolox_voc_s' │
├───────────────────┼────────────────────────────┤
│ test_size │ (640, 640) │
├───────────────────┼────────────────────────────┤
│ test_conf │ 0.01 │
├───────────────────┼────────────────────────────┤
│ nmsthre │ 0.65 │
╘═══════════════════╧════════════════════════════╛
2022-08-20 16:20:32.924 | INFO | yolox.core.trainer:before_train:136 - Model Summary: Params: 8.94M, Gflops: 26.64
2022-08-20 16:20:34.088 | INFO | yolox.core.trainer:resume_train:308 - loading checkpoint for fine tuning
2022-08-20 16:20:34.201 | WARNING | yolox.utils.checkpoint:load_ckpt:24 - Shape of head.cls_preds.0.weight in checkpoint is torch.Size([80, 128, 1, 1]), while shape of head.cls_preds.0.weight in model is torch.Size([2, 128, 1, 1]).
2022-08-20 16:20:34.201 | WARNING | yolox.utils.checkpoint:load_ckpt:24 - Shape of head.cls_preds.0.bias in checkpoint is torch.Size([80]), while shape of head.cls_preds.0.bias in model is torch.Size([2]).
2022-08-20 16:20:34.201 | WARNING | yolox.utils.checkpoint:load_ckpt:24 - Shape of head.cls_preds.1.weight in checkpoint is torch.Size([80, 128, 1, 1]), while shape of head.cls_preds.1.weight in model is torch.Size([2, 128, 1, 1]).
2022-08-20 16:20:34.202 | WARNING | yolox.utils.checkpoint:load_ckpt:24 - Shape of head.cls_preds.1.bias in checkpoint is torch.Size([80]), while shape of head.cls_preds.1.bias in model is torch.Size([2]).
2022-08-20 16:20:34.202 | WARNING | yolox.utils.checkpoint:load_ckpt:24 - Shape of head.cls_preds.2.weight in checkpoint is torch.Size([80, 128, 1, 1]), while shape of head.cls_preds.2.weight in model is torch.Size([2, 128, 1, 1]).
2022-08-20 16:20:34.202 | WARNING | yolox.utils.checkpoint:load_ckpt:24 - Shape of head.cls_preds.2.bias in checkpoint is torch.Size([80]), while shape of head.cls_preds.2.bias in model is torch.Size([2]).
2022-08-20 16:20:34.233 | ERROR | yolox.core.launch:launch:98 - An error has been caught in function 'launch', process 'MainProcess' (2532), thread 'MainThread' (9520):
Traceback (most recent call last):
File "tools/train.py", line 133, in <module>
launch(
└ <function launch at 0x000002C6938759D0>
> File "F:\OtherSoftware\Miniconda3\envs\pytorch\lib\site-packages\yolox-0.3.0-py3.8.egg\yolox\core\launch.py", line 98, in launch
main_func(*args)
│ └ (╒═══════════════════╤═══════════════════════════════════════════════════════════════════════════════════════════════════════...
└ <function main at 0x000002C6945773A0>
File "tools/train.py", line 117, in main
trainer.train()
│ └ <function Trainer.train at 0x000002C6959AD550>
└ <yolox.core.trainer.Trainer object at 0x000002C6959B7DC0>
File "F:\OtherSoftware\Miniconda3\envs\pytorch\lib\site-packages\yolox-0.3.0-py3.8.egg\yolox\core\trainer.py", line 74, in train
self.before_train()
│ └ <function Trainer.before_train at 0x000002C6959ADD30>
└ <yolox.core.trainer.Trainer object at 0x000002C6959B7DC0>
File "F:\OtherSoftware\Miniconda3\envs\pytorch\lib\site-packages\yolox-0.3.0-py3.8.egg\yolox\core\trainer.py", line 149, in before_train
self.train_loader = self.exp.get_data_loader(
│ │ │ └ <function Exp.get_data_loader at 0x000002C6959B48B0>
│ │ └ ╒═══════════════════╤════════════════════════════════════════════════════════════════════════════════════════════════════════...
│ └ <yolox.core.trainer.Trainer object at 0x000002C6959B7DC0>
└ <yolox.core.trainer.Trainer object at 0x000002C6959B7DC0>
File "D:\编程文档\Ai\YOLOX-0.3.0 (2)\exps/example/yolox_voc\yolox_voc_s.py", line 44, in get_data_loader
dataset = VOCDetection( # 修改训练集信息
└ <class 'yolox.data.datasets.voc.VOCDetection'>
File "F:\OtherSoftware\Miniconda3\envs\pytorch\lib\site-packages\yolox-0.3.0-py3.8.egg\yolox\data\datasets\voc.py", line 123, in __init__
for (year, name) in image_sets:
└ ['train']
ValueError: too many values to unpack (expected 2)
题主,我也出现了跟你一样的问题