You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TypeError: only integer scalar arrays can be converted to a scalar index while python ../code/utils/extract_official_train_test_set_from_mat.py nyu_depth_v2_labeled.mat splits.mat ./nyu_depth_v2/official_splits/
#29
Open
premchedella opened this issue
Nov 16, 2022
· 1 comment
When I ran the following python ../code/utils/extract_official_train_test_set_from_mat.py nyu_depth_v2_labeled.mat splits.mat ./nyu_depth_v2/official_splits/
Got the follwoing:
795 training images
654 test images
reading nyu_depth_v2_labeled.mat
<HDF5 dataset "sceneTypes": shape (1, 1449), type "|O">
Traceback (most recent call last):
File "../code/utils/extract_official_train_test_set_from_mat.py", line 88, in <module>
scenes = [u''.join(chr(c) for c in h5_file[obj_ref]) for obj_ref in h5_file['sceneTypes'][0]]
File "../code/utils/extract_official_train_test_set_from_mat.py", line 88, in <listcomp>
scenes = [u''.join(chr(c) for c in h5_file[obj_ref]) for obj_ref in h5_file['sceneTypes'][0]]
File "../code/utils/extract_official_train_test_set_from_mat.py", line 88, in <genexpr>
scenes = [u''.join(chr(c) for c in h5_file[obj_ref]) for obj_ref in h5_file['sceneTypes'][0]]
TypeError: only integer scalar arrays can be converted to a scalar index
Any clue to how to resolve this error.
The text was updated successfully, but these errors were encountered:
I was able to resolve the TypeError: only integer scalar arrays can be converted to a scalar index. Following is the change
scenes = [u''.join(chr(c) for c in h5_file[obj_ref]) for obj_ref in h5_file['sceneTypes'][0]]
to scenes = [u''.join(chr(c[0]) for c in h5_file[obj_ref]) for obj_ref in h5_file['sceneTypes'][0]]
When I ran the following
python ../code/utils/extract_official_train_test_set_from_mat.py nyu_depth_v2_labeled.mat splits.mat ./nyu_depth_v2/official_splits/
Got the follwoing:
Any clue to how to resolve this error.
The text was updated successfully, but these errors were encountered: