GabrielMajeri / nyuv2-python-toolbox

Python toolbox for the NYU Depth Dataset V2
MIT License
76 stars 11 forks source link

I got the following error when running the test #4

Closed zekariass closed 2 years ago

zekariass commented 4 years ago

C:\Users\ZAK\Pytorch working folder\MY_THESIS_DEPTH_ESTIMATION\nyuv2-python-toolbox\nyuv2\labeled.py:17: H5pyDeprecationWarning: The default file mode will change to 'r' (read-only) in h5py 3.0. To suppress this warning, pass the mode you need to h5py.File(), or set the global default h5.get_config().default_file_mode, or set the environment variable H5PY_DEFAULT_READONLY=1. Available modes are: 'r', 'r+', 'w', 'w-'/'x', 'a'. See the docs for details. self.depth_maps = getDepthImages(self.file)

KeyError Traceback (most recent call last)

in ----> 1 test_labeled_dataset() 2 #test_raw_dataset() in test_labeled_dataset() 14 15 def test_labeled_dataset(): ---> 16 labeled = LabeledDataset(DATASET_DIR / 'nyu_depth_v2_labeled') 17 18 color, depth = labeled[42] ~\Pytorch working folder\MY_THESIS_DEPTH_ESTIMATION\nyuv2-python-toolbox\nyuv2\labeled.py in __init__(self, path) 16 """Opens the labeled dataset file at the given path.""" 17 self.file = h5py.File(path) ---> 18 self.color_maps = self.file['images'] 19 self.depth_maps = self.file['depths'] 20 h5py\_objects.pyx in h5py._objects.with_phil.wrapper() h5py\_objects.pyx in h5py._objects.with_phil.wrapper() C:\Anaconda3\Anaconda3\lib\site-packages\h5py\_hl\group.py in __getitem__(self, name) 262 raise ValueError("Invalid HDF5 object reference") 263 else: --> 264 oid = h5o.open(self.id, self._e(name), lapl=self._lapl) 265 266 otype = h5i.get_type(oid) h5py\_objects.pyx in h5py._objects.with_phil.wrapper() h5py\_objects.pyx in h5py._objects.with_phil.wrapper() h5py\h5o.pyx in h5py.h5o.open() KeyError: "Unable to open object (object 'images' doesn't exist)"
GabrielMajeri commented 4 years ago

Have you downloaded and placed the labeled subset of data as described in the readme for the dataset directory?

Also, are you running the script with the current directory set as the repo's root?

sownds7 commented 3 years ago

Hi Gabriel!

I am also getting the same error. I have placed cafe.zip file under dataset folder. I am running the script with the current directory set as the repo's root. Still encountering this error. Can you please help me view the labeled dataset ?

Thank you in advance.

GabrielMajeri commented 3 years ago

@sownds7 I've pushed a fix for the h5py warning. Can you try again and tell me if you get the same error, or if anything has changed?

GabrielMajeri commented 2 years ago

I'm closing this since I'm assuming the problem got solved in the meantime.

Please reopen the issue if it still occurs.