Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileNotFoundError: [Errno 2] No such file or directory: '../annotations/person_keypoints_train2017.json' #4

Open
vishnukv64 opened this issue Feb 12, 2020 · 7 comments

Comments

@vishnukv64
Copy link

im getting this error, i followed all the steps properly and shifted everything to 80classes.

This error arises in:
raceback (most recent call last):
File "train.py", line 89, in
dataset = ListDataset(train_path, augment=opt.augment,use_mix=opt.mix_up, multiscale=opt.multiscale_training,normalized_labels=True)
File "/home/amvar/vishnu/YOLO_NANO/Yolo_Nano/utils/datasets.py", line 77, in init
self.annotations = COCO(json_root)
File "/home/amvar/vishnu/YOLO_NANO/venv/lib/python3.6/site-packages/pycocotools/coco.py", line 84, in init
dataset = json.load(open(annotation_file, 'r'))
FileNotFoundError: [Errno 2] No such file or directory: '../annotations/person_keypoints_train2017.json'

i really dont know where it went wrong, and why is it asking for a personkey train.json and not instance json.

Thanks in advance

@lingtengqiu
Copy link
Owner

lingtengqiu commented Feb 12, 2020 via email

@vishnukv64
Copy link
Author

the config youre talking about, is it the yolo-nano.cfg or yolo-nan-person.cfg...

coz i dont want only person, i want to train for the whole 80 classes, with coco 2014 dataset and not 2017 dataset..

btw thanks for your fast reply .

@miaochenGuo
Copy link

sorry, i can not find where to modify it...

@Xerus-git
Copy link

Xerus-git commented Mar 6, 2020

Hi,
you can try to modify "data/default_path.py"->coco_train path.
ex:
"coco_train": {
"img_dir": "data/coco/images/train2014/",
"annotations":"data/coco/annotations/instances_train2014.json"
}

And the path of the dataset must be created in accordance with the coco-format.

data
|___coco
  |__________annotations
     |____instances_train2014.json
    |____instances_val2014.json   |__________images
     |____train2014
     |____val2014

It works for me.

@ExcellentHunter
Copy link

Hi,
you can try to modify "data/default_path.py"->coco_train path.
ex:
"coco_train": {
"img_dir": "data/coco/images/train2014/",
"annotations":"data/coco/annotations/instances_train2014.json"
}

And the path of the dataset must be created in accordance with the coco-format.

data
|___coco
  |__________annotations
     |____instances_train2014.json
    |____instances_val2014.json   |__________images
     |____train2014
     |____val2014

It works for me.

我按照你的思路改了一下,在Evaluating Model时报错FileNotFoundError: [Errno 2] No such file or directory: '../annotations/person_keypoints_val2014.json',但是我在default_path.py中更改了coco_test路径为"data/coco/annotations/person_keypoints_val2014.json"

@ExcellentHunter
Copy link

you can modify it in config . it‘s traning set for human coco in 2017, espically for pose . of course pose means have human that’s why we use it to train our model.

------------------ Original ------------------ From: vishnukv64 <[email protected]> Date: Wed,Feb 12,2020 10:10 PM To: lingtengqiu/Yolo_Nano <[email protected]> Cc: Subscribed <[email protected]> Subject: Re: [lingtengqiu/Yolo_Nano] FileNotFoundError: [Errno 2] No such file or directory: '../annotations/person_keypoints_train2017.json' (#4) im getting this error, i followed all the steps properly and shifted everything to 80classes. This error arises in: raceback (most recent call last): File "train.py", line 89, in dataset = ListDataset(train_path, augment=opt.augment,use_mix=opt.mix_up, multiscale=opt.multiscale_training,normalized_labels=True) File "/home/amvar/vishnu/YOLO_NANO/Yolo_Nano/utils/datasets.py", line 77, in init self.annotations = COCO(json_root) File "/home/amvar/vishnu/YOLO_NANO/venv/lib/python3.6/site-packages/pycocotools/coco.py", line 84, in init dataset = json.load(open(annotation_file, 'r')) FileNotFoundError: [Errno 2] No such file or directory: '../annotations/person_keypoints_train2017.json' i really dont know where it went wrong, and why is it asking for a personkey train.json and not instance json. Thanks in advance — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

您好,可以发个邮件或者qq请教您一下嘛,qq:956954782

@kulkarnikeerti
Copy link

Hi, you can try to modify "data/default_path.py"->coco_train path. ex: "coco_train": { "img_dir": "data/coco/images/train2014/", "annotations":"data/coco/annotations/instances_train2014.json" }

And the path of the dataset must be created in accordance with the coco-format.

data |___coco   |__________annotations      |____instances_train2014.json     |____instances_val2014.json   |__________images      |____train2014      |____val2014

It works for me.

Hi @Xerus-git
I did the same changes to train the model with all the 80 classes. But I end up with this error: RuntimeError: The size of tensor a (80) must match the size of tensor b (27) at non-singleton dimension 1 Do you know what might be causing this error? Thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants