FileNotFoundError: /private/home/shubhamgoel/data/CUB_200_2011/images/001.Black_footed_Albatross/Black_Footed_Albatross_0085_92.jpg
Closed this issue · 1 comments
Hi,
If I try to run this:
python -m src.experiments.benchmark \
--pred_pose \
--pretrained_network_path=cachedir/snapshots/cam/e400_cub_train_cam4/pred_net_600.pth \
--shape_path=cachedir/template_shape/bird_template.npy \
--nodataloader_computeMaskDt \
--split=test
from the Evaluation instructions on https://github.com/shubham-goel/ucmr,
I get an error:
FileNotFoundError: /private/home/shubhamgoel/data/CUB_200_2011/images/001.Black_footed_Albatross/Black_Footed_Albatross_0085_92.jpg
Full console log for that command is as follows:
root@dc751569af5a:/workspace# python -m src.experiments.benchmark \
> --pred_pose \
> --pretrained_network_path=cachedir/snapshots/cam/e400_cub_train_cam4/pred_net_600.pth \
> --shape_path=cachedir/template_shape/bird_template.npy \
> --nodataloader_computeMaskDt \
> --split=test
Display not found. Using Agg backend for matplotlib
Loading shape from cachedir/template_shape/bird_template.npy
verts: mean-centering by [ 0. 0.5093799 -0.01742622]
verts_uv: provided
faces_uv: from verts_uv
Setting up model..
Mesh contains 237x2=474 symmetric vertices, 81 indep vertices
textureImg: 128x256
loading /workspace/src/data/../../cachedir/cub/data/test_cub_cleaned.mat
2874 images
Writing to results//cub/results.npz
0%| | 0/22 [00:00<?, ?it/s]Traceback (most recent call last):
File "/opt/conda/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/opt/conda/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/workspace/src/experiments/benchmark.py", line 323, in <module>
app.run(main)
File "/opt/conda/lib/python3.6/site-packages/absl/app.py", line 299, in run
_run_main(main, args)
File "/opt/conda/lib/python3.6/site-packages/absl/app.py", line 250, in _run_main
sys.exit(main(argv))
File "/workspace/src/experiments/benchmark.py", line 320, in main
tester.test()
File "/workspace/src/experiments/benchmark.py", line 224, in test
for i, batch in enumerate(tqdm(self.dataloader)):
File "/opt/conda/lib/python3.6/site-packages/tqdm/_tqdm.py", line 1022, in __iter__
for obj in iterable:
File "/opt/conda/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 582, in __next__
return self._process_next_batch(batch)
File "/opt/conda/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 608, in _process_next_batch
raise batch.exc_type(batch.exc_msg)
FileNotFoundError: Traceback (most recent call last):
File "/opt/conda/lib/python3.6/site-packages/torch/utils/data/_utils/worker.py", line 99, in _worker_loop
samples = collate_fn([dataset[i] for i in batch_indices])
File "/opt/conda/lib/python3.6/site-packages/torch/utils/data/_utils/worker.py", line 99, in <listcomp>
samples = collate_fn([dataset[i] for i in batch_indices])
File "/workspace/src/data/base.py", line 294, in __getitem__
flipped, img, kp, mask, sfm_pose = self.forward_img(index)
File "/workspace/src/data/base.py", line 134, in forward_img
raise FileNotFoundError(img_path)
FileNotFoundError: /private/home/shubhamgoel/data/CUB_200_2011/images/001.Black_footed_Albatross/Black_Footed_Albatross_0085_92.jpg
Then whenever I looked in /ucmr/src/data I noticed that a lot of the *.py files have shubham
or shubhamgoel
in the paths. For instance,
cub_dir = '/data3/shubham/Imagenet/'
if not osp.isdir(cub_dir):
Is that intended? I'm not sure if that is creating the problem or if it's something else?
Hi @nightfarrow, you face this error because the code isn't able to find a copy of the CUB dataset. That's what all the paths containing shubham
/shubhamgoel
are pointing to. Please use the --cub_dir=DIR_PATH
option to point to the CUB dataset on your machine. ALternatively for a more permanent solution, add the path here as the default value for --cub_dir
.