tinyvision / DAMO-YOLO

DAMO-YOLO: a fast and accurate object detection method with some new techs, including NAS backbones, efficient RepGFPN, ZeroHead, AlignedOTA, and distillation enhancement.
Apache License 2.0
3.78k stars 477 forks source link

error when i training damo-yolo to ditect face #122

Open oussaifi-majdi opened 1 year ago

oussaifi-majdi commented 1 year ago

Before Asking

Search before asking

Question

!python converter.py \ -f damoyolo_tinynasL20_T.py \ -c /content/damo-yolo/damoyolo_tinynasL20_T_436.onnx \ --batch_size 1 \ --img_size 640

the Error

2023-08-18 16:55:33.105 | INFO | main:main:180 - args value: Namespace(mode='onnx', config_file='damoyolo_tinynasL20_T.py', benchmark=False, ckpt='/content/damo-yolo/damoyolo_tinynasL20_T_436.onnx', trt=False, trt_type='fp32', batch_size=1, img_size=640, input='images', output='output', opset=11, end2end=False, ort=False, trt_eval=False, with_preprocess=False, topk_all=100, iou_thres=0.65, conf_thres=0.05, device='0', opts=[]) 2023-08-18 16:55:33.236 | ERROR | main::278 - An error has been caught in function '', process 'MainProcess' (41628), thread 'MainThread' (134246818092864): Traceback (most recent call last):

File "/content/damo-yolo/converter.py", line 278, in main() └ <function main at 0x7a181b8277f0>

File "/content/damo-yolo/converter.py", line 204, in main ckpt = torch.load(args.ckpt, map_location=device) │ │ │ │ └ device(type='cpu') │ │ │ └ '/content/damo-yolo/damoyolo_tinynasL20_T_436.onnx' │ │ └ Namespace(mode='onnx', config_file='damoyolo_tinynasL20_T.py', benchmark=False, ckpt='/content/damo-yolo/damoyolotinynasL20... │ └ <function load at 0x7a1889f07640> └ <module 'torch' from '/usr/local/lib/python3.10/site-packages/torch/init.py'>

File "/usr/local/lib/python3.10/site-packages/torch/serialization.py", line 815, in load return _legacy_load(opened_file, map_location, pickle_module, pickle_load_args) │ │ │ │ └ {'encoding': 'utf-8'} │ │ │ └ <module 'pickle' from '/usr/local/lib/python3.10/pickle.py'> │ │ └ device(type='cpu') │ └ <_io.BufferedReader name='/content/damo-yolo/damoyolo_tinynasL20_T_436.onnx'> └ <function _legacy_load at 0x7a1889f077f0> File "/usr/local/lib/python3.10/site-packages/torch/serialization.py", line 1033, in _legacy_load magic_number = pickle_module.load(f, pickle_load_args) │ │ │ └ {'encoding': 'utf-8'} │ │ └ <_io.BufferedReader name='/content/damo-yolo/damoyolo_tinynasL20_T_436.onnx'> │ └ └ <module 'pickle' from '/usr/local/lib/python3.10/pickle.py'>

_pickle.UnpicklingError: invalid load key, '\x08'.

Additional

No response

ksv87 commented 7 months ago

error in you command

you

!python converter.py
-f damoyolo_tinynasL20_T.py
-c /content/damo-yolo/damoyolo_tinynasL20_T_436.onnx
--batch_size 1
--img_size 640

tutorial !python tools/converter.py -f configs/damoyolo_tinynasL25_S.py -c damoyolo_tinynasL25_S.pth --batch_size 1 --img_size 640

your need change .onnx to .pth in parameter -c (this is path to checkpoint)