javiribera / locating-objects-without-bboxes

PyTorch code for "Locating objects without bounding boxes" - Loss function and trained models
Other
249 stars 52 forks source link

W: The dataset directory data does not contain a CSV file with groundtruth. #17

Closed Eljefemasao closed 4 years ago

Eljefemasao commented 4 years ago

I implemented a command below

python -m object-locator.locate --dataset data --out result --model pupil,lambdaa=1,BS=64,SGD,LR1e-3,p=-1,ultrasmallNet.ckpt --ultrasmallnet

and got an error as follows:

W: The dataset directory data does not contain a CSV file with groundtruth. Metrics will not be evaluated. Only estimations will be returned. Loading checkpoint... \__ loaded checkpoint 'pupil,lambdaa=1,BS=64,SGD,LR1e-3,p=-1,ultrasmallNet.ckpt' with 6.02M trainable parameters DONE (took 0.076988 seconds) 0%| | 0/1 [00:00<?, ?it/s]<PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=612x408 at 0x7FF904D587B8> Traceback (most recent call last): File "/opt/conda/envs/object-locator/lib/python3.6/runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "/opt/conda/envs/object-locator/lib/python3.6/runpy.py", line 85, in _run_code exec(code, run_globals) File "/tmp/locating-objects-without-bboxes/object-locator/locate.py", line 186, in <module> total=len(testset_loader)): File "/opt/conda/envs/object-locator/lib/python3.6/site-packages/tqdm/_tqdm.py", line 940, in __iter__ for obj in iterable: File "/opt/conda/envs/object-locator/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 637, in __next__ return self._process_next_batch(batch) File "/opt/conda/envs/object-locator/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 658, in _process_next_batch raise batch.exc_type(batch.exc_msg) KeyError: 'Traceback (most recent call last):\n File "/opt/conda/envs/object-locator/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 138, in _worker_loop\n samples = collate_fn([dataset[i] for i in batch_indices])\n File "/opt/conda/envs/object-locator/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 138, in <listcomp>\n samples = collate_fn([dataset[i] for i in batch_indices])\n File "/tmp/locating-objects-without-bboxes/object-locator/data.py", line 291, in __getitem__\n dictionary[\'locations\'] = eval(dictionary[\'locations\'])\nKeyError: \'locations\'\n' ^X^C

There are any solution?

My Directory hierarchy is

test

Ground Truth file gt.csv includes

gt

Thanks.

javiribera commented 4 years ago

Try running with --evaluate

Eljefemasao commented 4 years ago

Everything went well. Thank you!