argusswift / YOLOv4-pytorch

This is a pytorch repository of YOLOv4, attentive YOLOv4 and mobilenet YOLOv4 with PASCAL VOC and COCO
1.68k stars 331 forks source link

_pickle.UnpicklingError: invalid load key, '\x00'. #115

Open lilangyi opened 3 years ago

lilangyi commented 3 years ago

执行训练的时候报了这个错怎么解决呢?环境:Pytorch1.5版本,ubuntu1604

jingtianyilong commented 3 years ago

network and pretrain weight unmatch

lilangyi commented 3 years ago

network and pretrain weight unmatch

MODEL_TYPE = { "TYPE": "Mobilenetv3-YOLOv4" } # YOLO type:YOLOv4, Mobilenet-YOLOv4 or Mobilenetv3-YOLOv4

我的配置如上,同时我创建的weight文件夹在项目下面,放入yolov4.weights和mobilenetv3.pth,依然抱错,如果我把TYPE换为YOLOV4,就报错如下:

Traceback (most recent call last): File "train.py", line 357, in fp_16=opt.fp_16, File "train.py", line 165, in train ) in enumerate(self.train_dataloader): File "/home/lee/anaconda3/envs/pytorch_1.5_py3.7/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 345, in next data = self._next_data() File "/home/lee/anaconda3/envs/pytorch_1.5_py3.7/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 385, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "/home/lee/anaconda3/envs/pytorch_1.5_py3.7/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/home/lee/anaconda3/envs/pytorch_1.5_py3.7/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in data = [self.dataset[idx] for idx in possibly_batched_index] File "/home/lee/Desktop/myfiles/20-12-21-pytorch-yolov4/YOLOv4-PyTorch/utils/datasets.py", line 59, in getitem ) = self.__creat_label(bboxes) File "/home/lee/Desktop/myfiles/20-12-21-pytorch-yolov4/YOLOv4-PyTorch/utils/datasets.py", line 168, in __creat_label one_hot[bbox_class_ind] = 1.0 IndexError: index 14 is out of bounds for axis 0 with size 1

jingtianyilong commented 3 years ago

So obviouslly yolov4 works but the mobilenet version don't. For the current error, label number don't match. Check your dataset setting. And try to debug yourself first. Tell us what you have done to fix this and fail and your thoughts.

paul0923 commented 3 years ago

请问这个问题解决了吗?怎么解决的?我也遇到了

lilangyi commented 3 years ago

请问这个问题解决了吗?怎么解决的?我也遇到了

检查下图片和标签是否都正确对应

mozeqiu commented 3 years ago

@lilangyi 你好 我用mobilenet-yolov4出现了这个问题,然后改成yolov4就能正常训练,这是什么原因呢,望解惑,谢谢!

tangning9495 commented 3 years ago

same problem。I only try to run torch.load(weights)... and the problem "_pickle.UnpicklingError: invalid load key, '\x00'. " is occured

tangning9495 commented 3 years ago

I use the nvidia-docker, Ubuntu, torch1.6+cuda10.1. I guess it's a problem about docker env。