dBeker / Faster-RCNN-TensorFlow-Python3

Tensorflow Faster R-CNN for Windows/Linux and Python 3 (3.5/3.6/3.7)
MIT License
612 stars 329 forks source link

"AssertionError: Path does not exist" when training with custom dataset #82

Closed movie3105 closed 5 years ago

movie3105 commented 5 years ago

i am newbie in this field can someone tell me how to solve this problem. i'm trying to train my own dataset and already put my anotation and my image to proper directory but why this error occurred ?

Traceback (most recent call last):
  File "train.py", line 215, in <module>
    train = Train()
  File "train.py", line 69, in __init__
    self.imdb, self.roidb = combined_roidb("voc_2007_trainval")
  File "train.py", line 48, in combined_roidb
    roidbs = [get_roidb(s) for s in imdb_names.split('+')]
  File "train.py", line 48, in <listcomp>
    roidbs = [get_roidb(s) for s in imdb_names.split('+')]
  File "train.py", line 41, in get_roidb
    imdb = get_imdb(imdb_name)
  File "E:\Program\Faster-RCNN-TensorFlow-Python3-master\lib\datasets\factory.py", line 42, in get_imdb
    return __sets[name]()
  File "E:\Program\Faster-RCNN-TensorFlow-Python3-master\lib\datasets\factory.py", line 23, in <lambda>
    __sets[name] = (lambda split=split, year=year: pascal_voc(split, year))
  File "E:\Program\Faster-RCNN-TensorFlow-Python3-master\lib\datasets\pascal_voc.py", line 41, in __init__
    self._image_index = self._load_image_set_index()
  File "E:\Program\Faster-RCNN-TensorFlow-Python3-master\lib\datasets\pascal_voc.py", line 84, in _load_image_set_index
    'Path does not exist: {}'.format(image_set_file)
AssertionError: Path does not exist: E:\Program\Faster-RCNN-TensorFlow-Python3-master\data\VOCdevkit2007\VOC2007\ImageSets\Main\trainval.txt
morpheusthewhite commented 5 years ago

Did you properly download and place all the required files?

movie3105 commented 5 years ago

i guess so sir,but ill try to make another clone to start form the begining again to see if i make a mistake

morpheusthewhite commented 5 years ago

If it does not work then post here the hierarchy of the folders

movie3105 commented 5 years ago

actually the hierarchy is the same with the one in https://github.com/dBeker/Faster-RCNN-TensorFlow-Python3 only the data/imagenet_weight got added but here the hierarchy hierarchy.txt

morpheusthewhite commented 5 years ago

You placed all the files in data/VOCdevkit while that folder should be data/VOCdevkit2007

Here it is how it should be

.
├── cache
│   └── voc_2007_trainval_gt_roidb.pkl
├── coco
│   ├── common
│   ├── license.txt
│   ├── LuaAPI
│   ├── MatlabAPI
│   ├── PythonAPI
│   ├── README.txt
│   └── results
├── demo
│   ├── 000456.jpg
│   ├── 000457.jpg
│   ├── 000542.jpg
│   ├── 001150.jpg
│   ├── 001763.jpg
│   └── 004545.jpg
├── imagenet_weights
│   └── vgg16.ckpt
├── VOCdevkit2007
│   ├── create_segmentations_from_detections.m
│   ├── devkit_doc.pdf
│   ├── example_classifier.m
│   ├── example_detector.m
│   ├── example_layout.m
│   ├── example_segmenter.m
│   ├── local
│   ├── results
│   ├── viewanno.m
│   ├── viewdet.m
│   ├── VOC2007
│   └── VOCcode
├── scripts
    └── fetch_faster_rcnn_models.sh
movie3105 commented 5 years ago

@morpheusthewhite thank you sir now it's work ill try to training my dataset now please help me again if i occured error again in the future my gratitude to you sir

morpheusthewhite commented 5 years ago

You're welcome

movie3105 commented 5 years ago

Set proposal method: gt Appending horizontally-flipped training examples... Traceback (most recent call last): File "train.py", line 215, in train = Train() File "train.py", line 69, in init self.imdb, self.roidb = combined_roidb("voc_2007_trainval") File "train.py", line 48, in combined_roidb roidbs = [get_roidb(s) for s in imdb_names.split('+')] File "train.py", line 48, in roidbs = [get_roidb(s) for s in imdb_names.split('+')] File "train.py", line 45, in get_roidb roidb = get_training_roidb(imdb) File "train.py", line 25, in get_training_roidb imdb.append_flipped_images() File "E:\Program\Faster-RCNN-TensorFlow-Python3-master\lib\datasets\imdb.py", line 112, in append_flipped_images widths = self._get_widths() File "E:\Program\Faster-RCNN-TensorFlow-Python3-master\lib\datasets\imdb.py", line 108, in _get_widths for i in range(self.num_images)] File "E:\Program\Faster-RCNN-TensorFlow-Python3-master\lib\datasets\imdb.py", line 108, in for i in range(self.num_images)] File "E:\Program\Faster-RCNN-TensorFlow-Python3-master\lib\datasets\pascal_voc.py", line 63, in image_path_at return self.image_path_from_index(self._image_index[i]) File "E:\Program\Faster-RCNN-TensorFlow-Python3-master\lib\datasets\pascal_voc.py", line 72, in image_path_from_index 'Path does not exist: {}'.format(image_path) AssertionError: Path does not exist: E:\Program\Faster-RCNN-TensorFlow-Python3-master\data\VOCdevkit2007\VOC2007\JPEGImages\000005.jpg

@morpheusthewhite why this error occured ? i already delete all the former training data a at E:\Program\Faster-RCNN-TensorFlow-Python3-master\data\VOCdevkit2007\VOC2007\JPEGImages and change it to my own dataset but why it searching for the old dataset ?

movie3105 commented 5 years ago

can you explain how can i resolve this error ?