Skip to content

When using the v8 version for training, I added the pre-training weight file of yolov8l.pt to mot17_train_cfg.py and encountered a problem. #26

@luke110

Description

@luke110

I rewrote the build trainer in mot17_train_config.py

Like this:

train = dict(
output_dir="./yolov8_mot17_train-all",
init_checkpoint="/HOME/scw6492/run/luke/yolov8/pretrain/yolov8l.pt",

I only change this.

Next I encountered the following problem:
[01/19 14:05:56 d2.checkpoint.detection_checkpoint]: [DetectionCheckpointer] Loading from /HOME/scw6492/run/luke/yolov8/pretrain/yolov8l.pt ...
[01/19 14:05:56 fvcore.common.checkpoint]: [Checkpointer] Loading from /HOME/scw6492/run/luke/yolov8/pretrain/yolov8l.pt ...
Traceback (most recent call last):
File "/HOME/scw6492/run/luke/yolov8/train.py", line 181, in
launch(
File "/data/run01/scw6492/luke/yolov8/detectron2/detectron2/engine/launch.py", line 69, in launch
mp.start_processes(
File "/HOME/scw6492/.conda/envs/sparse/lib/python3.9/site-packages/torch/multiprocessing/spawn.py", line 197, in start_processes
while not context.join():
File "/HOME/scw6492/.conda/envs/sparse/lib/python3.9/site-packages/torch/multiprocessing/spawn.py", line 160, in join
raise ProcessRaisedException(msg, error_index, failed_process.pid)
torch.multiprocessing.spawn.ProcessRaisedException:

-- Process 0 terminated with the following error:
Traceback (most recent call last):
File "/HOME/scw6492/.conda/envs/sparse/lib/python3.9/site-packages/torch/multiprocessing/spawn.py", line 69, in _wrap
fn(i, *args)
File "/data/run01/scw6492/luke/yolov8/detectron2/detectron2/engine/launch.py", line 123, in _distributed_worker
main_func(*args)
File "/HOME/scw6492/run/luke/yolov8/train.py", line 176, in main
do_train(args, cfg)
File "/HOME/scw6492/run/luke/yolov8/train.py", line 144, in do_train
checkpointer.resume_or_load(cfg.train.init_checkpoint, resume=args.resume)
File "/HOME/scw6492/.conda/envs/sparse/lib/python3.9/site-packages/fvcore/common/checkpoint.py", line 227, in resume_or_load
return self.load(path, checkpointables=[])
File "/data/run01/scw6492/luke/yolov8/detectron2/detectron2/checkpoint/detection_checkpoint.py", line 62, in load
ret = super().load(path, *args, **kwargs)
File "/HOME/scw6492/.conda/envs/sparse/lib/python3.9/site-packages/fvcore/common/checkpoint.py", line 156, in load
incompatible = self._load_model(checkpoint)
File "/data/run01/scw6492/luke/yolov8/detectron2/detectron2/checkpoint/detection_checkpoint.py", line 126, in _load_model
incompatible = super()._load_model(checkpoint)
File "/HOME/scw6492/.conda/envs/sparse/lib/python3.9/site-packages/fvcore/common/checkpoint.py", line 273, in _load_model
self._convert_ndarray_to_tensor(checkpoint_state_dict)
File "/HOME/scw6492/.conda/envs/sparse/lib/python3.9/site-packages/fvcore/common/checkpoint.py", line 366, in _convert_ndarray_to_tensor
for k in list(state_dict.keys()):
File "/HOME/scw6492/.conda/envs/sparse/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1614, in getattr
raise AttributeError("'{}' object has no attribute '{}'".format(
AttributeError: 'DetectionModel' object has no attribute 'keys'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions