coldlarry / YOLOv3-complete-pruning

提供对YOLOv3及Tiny的多种剪枝版本,以适应不同的需求。
805 stars 214 forks source link

报错:No such a file or directory: 'data/2007_val.shapes',请问怎么解决呢? #82

Open 1343464520 opened 4 years ago

1343464520 commented 4 years ago

(env_python3.6) devin@devin:/media/devin/Elements/YOLOv3-complete-pruning-master$ python3 train_person.py --data data/obj_person.data --batch-size 16 --accumulate 1 --weights weights/weights/yolov3.weights --cfg cfg/yolov3-person.cfg Namespace(accumulate=1, adam=False, arc='default', batch_size=16, bucket='', cache_images=False, cfg='cfg/yolov3-person.cfg', data='data/obj_person.data', device='', epochs=273, evolve=False, img_size=416, img_weights=False, multi_scale=False, name='', nosave=False, notest=False, prebias=False, prune=0, rect=False, resume=False, s=0.001, sr=False, transfer=False, var=None, weights='weights/weights/yolov3.weights') Using CUDA device0 _CudaDeviceProperties(name='GeForce GTX 1070', total_memory=8117MB)

single-gpu sparse normal sparse training Reading labels (16839 found, 0 missing, 17 empty for 16856 images): 100%|█| 16856/16856 [00:02<00:00, Model Summary: 222 layers, 6.15237e+07 parameters, 6.15237e+07 gradients Starting training for 273 epochs...

 Epoch   gpu_mem      GIoU       obj       cls     total   targets  img_size
 0/272     7.23G     0.874     0.566         0      1.44        16       416: 100%|█| 1054/1054 [

Reading image shapes: 97%|███████████████████████████████████ | 2308/2372 [00:00<00:00, 7707.11it/s]Traceback (most recent call last): File "/media/devin/Elements/YOLOv3-complete-pruning-master/utils/datasets.py", line 287, in init with open(sp, 'r') as f: # read existing shapefile FileNotFoundError: [Errno 2] No such file or directory: 'data/2007_val_ubuntu.shapes'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "train_person.py", line 479, in train() # train normally File "train_person.py", line 360, in train save_json=final_epoch and epoch > 0 and 'coco.data' in data) File "/media/devin/Elements/YOLOv3-complete-pruning-master/test.py", line 55, in test dataset = LoadImagesAndLabels(test_path, img_size, batch_size) File "/media/devin/Elements/YOLOv3-complete-pruning-master/utils/datasets.py", line 291, in init s = [exif_size(Image.open(f)) for f in tqdm(self.img_files, desc='Reading image shapes')] File "/media/devin/Elements/YOLOv3-complete-pruning-master/utils/datasets.py", line 291, in s = [exif_size(Image.open(f)) for f in tqdm(self.img_files, desc='Reading image shapes')] File "/home/devin/anaconda3/envs/env_python3.6/lib/python3.6/site-packages/PIL/Image.py", line 2609, in open fp = builtins.open(filename, "rb") FileNotFoundError: [Errno 2] No such file or directory: '/media/devin/B4FC4C43FC4BFDDC/Darknet-win/darknet-master/scripts/VOCdevkit_person/VOC2007/JPEGImages/640x480_9998.jpg' Reading image shapes: 100%|███████████████████████████████████▉| 2370/2372 [00:00<00:00, 7063.36it/s]

1343464520 commented 4 years ago

另外,我的训练集中缺失一些图片(有label,无图片),这个在darknet版本中训练没有报错的,这里必须严格把图片和label数保持一致吗?谢谢!