I'm running the command:
python main.py -- prepare_masks
and getting the following error:
neptune: Executing in Offline Mode.
neptune: Executing in Offline Mode.
2018-09-18 09-15-04 mapping-challenge >>> Overlaying masks, dataset: train
2018-09-18 09-15-04 mapping-challenge >>> Output directory: ~/open-solution-mapping-challenge/data/masks_overlayed_eroded_0_dilated_2
loading annotations into memory...
Traceback (most recent call last):
File "main.py", line 93, in
main()
File "/home/derose/anaconda3/lib/python3.6/site-packages/click/core.py", line 722, in call
return self.main(args, kwargs)
File "/home/derose/anaconda3/lib/python3.6/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/home/derose/anaconda3/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/derose/anaconda3/lib/python3.6/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, ctx.params)
File "/home/derose/anaconda3/lib/python3.6/site-packages/click/core.py", line 535, in invoke
return callback(args, **kwargs)
File "main.py", line 15, in prepare_masks
pipeline_manager.prepare_masks(dev_mode)
File "/home/derose/open-solution-mapping-challenge/src/pipeline_manager.py", line 26, in prepare_masks
prepare_masks(dev_mode, self.logger, self.params)
File "/home/derose/open-solution-mapping-challenge/src/pipeline_manager.py", line 61, in prepare_masks
small_annotations_size=params.small_annotations_size)
File "/home/derose/open-solution-mapping-challenge/src/preparation.py", line 28, in overlay_masks
coco = COCO(annotation_file_path)
File "/home/derose/anaconda3/lib/python3.6/site-packages/pycocotools/coco.py", line 79, in init
dataset = json.load(open(annotation_file, 'r'))
FileNotFoundError: [Errno 2] No such file or directory: '~/open-solution-mapping-challenge/data/train/annotation.json'
I've checked many times that annotation.json is in the right directory, and i also tried re-extracting it. @taraspiotr suggested preparing the metadata first but it doesn't matter which order I run the commands in. I have a stage1_metadata.csv but it is empty.
I think I fixed the issue by replacing ~/ in the file path with the full home/username. At least, it started trying to actually work but then it overwhelmed my system's resources with the number of files.
Using Ubuntu 16.04 and Python 3.6
I'm running the command:
python main.py -- prepare_masks
and getting the following error:neptune: Executing in Offline Mode. neptune: Executing in Offline Mode. 2018-09-18 09-15-04 mapping-challenge >>> Overlaying masks, dataset: train 2018-09-18 09-15-04 mapping-challenge >>> Output directory: ~/open-solution-mapping-challenge/data/masks_overlayed_eroded_0_dilated_2 loading annotations into memory... Traceback (most recent call last): File "main.py", line 93, in
main()
File "/home/derose/anaconda3/lib/python3.6/site-packages/click/core.py", line 722, in call
return self.main(args, kwargs)
File "/home/derose/anaconda3/lib/python3.6/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/home/derose/anaconda3/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/derose/anaconda3/lib/python3.6/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, ctx.params)
File "/home/derose/anaconda3/lib/python3.6/site-packages/click/core.py", line 535, in invoke
return callback(args, **kwargs)
File "main.py", line 15, in prepare_masks
pipeline_manager.prepare_masks(dev_mode)
File "/home/derose/open-solution-mapping-challenge/src/pipeline_manager.py", line 26, in prepare_masks
prepare_masks(dev_mode, self.logger, self.params)
File "/home/derose/open-solution-mapping-challenge/src/pipeline_manager.py", line 61, in prepare_masks
small_annotations_size=params.small_annotations_size)
File "/home/derose/open-solution-mapping-challenge/src/preparation.py", line 28, in overlay_masks
coco = COCO(annotation_file_path)
File "/home/derose/anaconda3/lib/python3.6/site-packages/pycocotools/coco.py", line 79, in init
dataset = json.load(open(annotation_file, 'r'))
FileNotFoundError: [Errno 2] No such file or directory: '~/open-solution-mapping-challenge/data/train/annotation.json'
I've checked many times that annotation.json is in the right directory, and i also tried re-extracting it. @taraspiotr suggested preparing the metadata first but it doesn't matter which order I run the commands in. I have a stage1_metadata.csv but it is empty.