yolov7 icon indicating copy to clipboard operation
yolov7 copied to clipboard

_pickle.UnpicklingError: STACK_GLOBAL requires str

Open AT9991 opened this issue 2 years ago • 7 comments

Can anyone please help, why I might be getting this error while running train.py.

A few days ago, the error was not there.

Transferred 330/344 items from yolov7-tiny.pt Scaled weight_decay = 0.0005 Optimizer groups: 58 .bias, 58 conv.weight, 61 other Traceback (most recent call last): File "train.py", line 616, in train(hyp, opt, device, tb_writer) File "train.py", line 245, in train dataloader, dataset = create_dataloader(train_path, imgsz, batch_size, gs, opt, File "/content/yolov7/utils/datasets.py", line 69, in create_dataloader dataset = LoadImagesAndLabels(path, imgsz, batch_size, File "/content/yolov7/utils/datasets.py", line 392, in init cache, exists = torch.load(cache_path), True # load File "/usr/local/lib/python3.8/dist-packages/torch/serialization.py", line 795, in load return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args) File "/usr/local/lib/python3.8/dist-packages/torch/serialization.py", line 1002, in _legacy_load magic_number = pickle_module.load(f, **pickle_load_args) _pickle.UnpicklingError: STACK_GLOBAL requires str

AT9991 avatar Feb 22 '23 22:02 AT9991

I am also facing same problem. Anyone has any idea why?

imihassan avatar Mar 08 '23 16:03 imihassan

Same issue.

TECOLOGYxyz avatar Mar 24 '23 14:03 TECOLOGYxyz

Try to delete the .cache file in your training or testing path, this works for me.

lihaolin88 avatar Apr 06 '23 20:04 lihaolin88

Try to delete the .cache file in your training or testing path, this works for me.

And how can I find the cache file in my training or testing path?

adilraja avatar Sep 10 '23 20:09 adilraja

Try to delete the .cache file in your training or testing path, this works for me.

And how can I find the cache file in my training or testing path?

Oops... I found it. What you meant was to remove the .cache files in the path of the training or testing datasets.

adilraja avatar Sep 10 '23 20:09 adilraja

Still not working for me though

Anushka-N12 avatar Dec 24 '23 10:12 Anushka-N12

deleting .cache files worked for me too thx :)

SebiGoebel avatar Apr 24 '24 09:04 SebiGoebel