facebookresearch / maskrcnn-benchmark

Fast, modular reference implementation of Instance Segmentation and Object Detection algorithms in PyTorch.
MIT License
9.3k stars 2.49k forks source link

[Errno 2] No such file or directory: 'datasets/coco/annotations/instances_train2017.json' #791

Open weweus opened 5 years ago

weweus commented 5 years ago

Please help me

I tried to train my coco data with jupyter notebook, and when I imported pycocotools, the instances_train2017.json was loaded into memory from pycocotools.coco import COCO

datadir = '/home/wxd/maskrcnn-benchmark/maskrcnn_benchmark'

datatype = 'train2017'

annFile = '{}/datasets/coco/instances_{}.json'.format(datadir,datatype)

coco = COCO(annFile)

loading annotations into memory... Done (t=13.69s) creating index... index created!

However, when I tried run /home/wxd/maskrcnn-benchmark/tools/train_net.py --config-file "/home/wxd/maskrcnn-benchmark/wxd_config/e2e_mask_rcnn_R_50_FPN_1x.yaml" I got "[Errno 2] No such file or directory: 'datasets/coco/annotations/instances_train2017.json'"

tangjiuqi097 commented 5 years ago

You can run the script at '/home/wxd/maskrcnn-benchmark/' instead of '/home/wxd/maskrcnn-benchmark/tools/'.

xjjs commented 5 years ago

@weweus the data directory should be "/maskrcnn-benchmark/datasets/coco" instead of "/maskrcnn-benchmark/maskrcnn_benchmark/data/datasets/coco"

mnorouzif commented 4 years ago

Hi @weweus Would you mind sharing the solution if the error is solved? Thank you.