yxKryptonite/OpenFMNav

Getting IndexError: list index out of range

Closed this issue · 4 comments

Hi, I'm getting the following exception:

 File "/home/ftaioli/projects/OpenFMNav/envs/habitat/objectgoal_env21.py", line 219, in _preprocess_semantic
    if self.scene.objects[se[i]].category.name() in self.hm3d_semantic_mapping:
IndexError: list index out of range

as soon as I start the evaluation with the following command:

CUDA_VISIBLE_DEVICES=0 python main.py --split val --eval 1 --auto_gpu_config 0 --prompt_type scoring -n 1 --num_eval_episodes 100 --text_threshold 0.55 --boundary_coeff 12 --start_episode 0 --tag_freq 100 --use_gtsem 0 --num_local_steps 20 --print_images 1 --exp_name test

Infos

I downloaded the scene dataset with the following command:
python -m habitat_sim.utils.datasets_download --username <api-token-id> --password <api-token-secret> --uids hm3d_val_v0.1

and downloaded the task dataset from here.
Specifically, I've tried objectnav_hm3d_v1.zip and with objectnav_hm3d_v2.zip.

Did you encounter this particular issue?

Hi, have you tried downloading the scene dataset from https://github.com/matterport/habitat-matterport-3dresearch? I use v0.2 and it works fine.

Yes, same error. Just to confirm, my scene dataset folder looks like this:

├── 00800-TEEsavR23oF
│   ├── TEEsavR23oF.basis.glb
│   ├── TEEsavR23oF.basis.navmesh
│   ├── TEEsavR23oF.semantic.glb
│   └── TEEsavR23oF.semantic.txt
├── 00801-HaxA7YrQdEC
│   ├── HaxA7YrQdEC.basis.glb
│   └── HaxA7YrQdEC.basis.navmesh
├── 00802-wcojb4TFT35
│   ├── wcojb4TFT35.basis.glb
│   ├── wcojb4TFT35.basis.navmesh
│   ├── wcojb4TFT35.semantic.glb
│   └── wcojb4TFT35.semantic.txt
├── 00803-k1cupFYWXJ6
│   ├── k1cupFYWXJ6.basis.glb
│   ├── k1cupFYWXJ6.basis.navmesh
│   ├── k1cupFYWXJ6.semantic.glb
│   └── k1cupFYWXJ6.semantic.txt
├── 00804-BHXhpBwSMLh
│   ├── BHXhpBwSMLh.basis.glb
│   └── BHXhpBwSMLh.basis.navmesh
├── 00805-SUHsP6z2gcJ
│   ├── SUHsP6z2gcJ.basis.glb
│   └── SUHsP6z2gcJ.basis.navmesh
├── 00806-tQ5s4ShP627
│   ├── tQ5s4ShP627.basis.glb
│   └── tQ5s4ShP627.basis.navmesh
├── 00807-rsggHU7g7dh
│   ├── rsggHU7g7dh.basis.glb
│   └── rsggHU7g7dh.basis.navmesh
├── 00808-y9hTuugGdiq
│   ├── y9hTuugGdiq.basis.glb
│   ├── y9hTuugGdiq.basis.navmesh
│   ├── y9hTuugGdiq.semantic.glb
│   └── y9hTuugGdiq.semantic.txt
├── 00809-Qpor2mEya8F
│   ├── Qpor2mEya8F.basis.glb
│   └── Qpor2mEya8F.basis.navmesh
├── 00810-CrMo8WxCyVb
│   ├── CrMo8WxCyVb.basis.glb
│   ├── CrMo8WxCyVb.basis.navmesh
│   ├── CrMo8WxCyVb.semantic.glb
│   └── CrMo8WxCyVb.semantic.txt
├── 00811-7UrtFsADwob
│   ├── 7UrtFsADwob.basis.glb
│   └── 7UrtFsADwob.basis.navmesh
├── 00812-mma8eWq3nNQ
│   ├── mma8eWq3nNQ.basis.glb
│   └── mma8eWq3nNQ.basis.navmesh
├── 00813-svBbv1Pavdk
│   ├── svBbv1Pavdk.basis.glb
│   ├── svBbv1Pavdk.basis.navmesh
│   ├── svBbv1Pavdk.semantic.glb
│   └── svBbv1Pavdk.semantic.txt
├── 00814-p53SfW6mjZe
│   ├── p53SfW6mjZe.basis.glb
│   ├── p53SfW6mjZe.basis.navmesh
│   ├── p53SfW6mjZe.semantic.glb
│   └── p53SfW6mjZe.semantic.txt
├── 00815-h1zeeAwLh9Z
│   ├── h1zeeAwLh9Z.basis.glb
│   ├── h1zeeAwLh9Z.basis.navmesh
│   ├── h1zeeAwLh9Z.semantic.glb
│   └── h1zeeAwLh9Z.semantic.txt
├── 00816-q3hn1WQ12rz
│   ├── q3hn1WQ12rz.basis.glb
│   └── q3hn1WQ12rz.basis.navmesh
├── 00817-X4qjx5vquwH
│   ├── X4qjx5vquwH.basis.glb
│   └── X4qjx5vquwH.basis.navmesh
├── 00818-rJhMRvNn4DS
│   ├── rJhMRvNn4DS.basis.glb
│   └── rJhMRvNn4DS.basis.navmesh
├── 00819-6D36GQHuP8H
│   ├── 6D36GQHuP8H.basis.glb
│   └── 6D36GQHuP8H.basis.navmesh
├── 00820-mL8ThkuaVTM
│   ├── mL8ThkuaVTM.basis.glb
│   ├── mL8ThkuaVTM.basis.navmesh
│   ├── mL8ThkuaVTM.semantic.glb
│   └── mL8ThkuaVTM.semantic.txt
├── 00821-eF36g7L6Z9M
│   ├── eF36g7L6Z9M.basis.glb
│   ├── eF36g7L6Z9M.basis.navmesh
│   ├── eF36g7L6Z9M.semantic.glb
│   └── eF36g7L6Z9M.semantic.txt
├── 00822-nrA1tAA17Yp
│   ├── nrA1tAA17Yp.basis.glb
│   └── nrA1tAA17Yp.basis.navmesh
├── 00823-7MXmsvcQjpJ
│   ├── 7MXmsvcQjpJ.basis.glb
│   ├── 7MXmsvcQjpJ.basis.navmesh
│   ├── 7MXmsvcQjpJ.semantic.glb
│   └── 7MXmsvcQjpJ.semantic.txt
├── 00824-Dd4bFSTQ8gi
│   ├── Dd4bFSTQ8gi.basis.glb
│   ├── Dd4bFSTQ8gi.basis.navmesh
│   ├── Dd4bFSTQ8gi.semantic.glb
│   └── Dd4bFSTQ8gi.semantic.txt
├── 00825-jgPBycuV1Jq
│   ├── jgPBycuV1Jq.basis.glb
│   └── jgPBycuV1Jq.basis.navmesh
├── 00826-BFRyYbPCCPE
│   ├── BFRyYbPCCPE.basis.glb
│   └── BFRyYbPCCPE.basis.navmesh
├── 00827-BAbdmeyTvMZ
│   ├── BAbdmeyTvMZ.basis.glb
│   ├── BAbdmeyTvMZ.basis.navmesh
│   ├── BAbdmeyTvMZ.semantic.glb
│   └── BAbdmeyTvMZ.semantic.txt
├── 00828-X7gTkoDHViv
│   ├── X7gTkoDHViv.basis.glb
│   └── X7gTkoDHViv.basis.navmesh
├── 00829-QaLdnwvtxbs
│   ├── QaLdnwvtxbs.basis.glb
│   ├── QaLdnwvtxbs.basis.navmesh
│   ├── QaLdnwvtxbs.semantic.glb
│   └── QaLdnwvtxbs.semantic.txt
├── 00830-5jp3fCRSRjc
│   ├── 5jp3fCRSRjc.basis.glb
│   └── 5jp3fCRSRjc.basis.navmesh
├── 00831-yr17PDCnDDW
│   ├── yr17PDCnDDW.basis.glb
│   ├── yr17PDCnDDW.basis.navmesh
│   ├── yr17PDCnDDW.semantic.glb
│   └── yr17PDCnDDW.semantic.txt
├── 00832-qyAac8rV8Zk
│   ├── qyAac8rV8Zk.basis.glb
│   ├── qyAac8rV8Zk.basis.navmesh
│   ├── qyAac8rV8Zk.semantic.glb
│   └── qyAac8rV8Zk.semantic.txt
├── 00833-dHwjuKfkRUR
│   ├── dHwjuKfkRUR.basis.glb
│   └── dHwjuKfkRUR.basis.navmesh
├── 00834-AWUFxHEyV3T
│   ├── AWUFxHEyV3T.basis.glb
│   └── AWUFxHEyV3T.basis.navmesh
├── 00835-q3zU7Yy5E5s
│   ├── q3zU7Yy5E5s.basis.glb
│   ├── q3zU7Yy5E5s.basis.navmesh
│   ├── q3zU7Yy5E5s.semantic.glb
│   └── q3zU7Yy5E5s.semantic.txt
├── 00836-7GAhQPFzMot
│   ├── 7GAhQPFzMot.basis.glb
│   └── 7GAhQPFzMot.basis.navmesh
├── 00837-vBMLrTe4uLA
│   ├── vBMLrTe4uLA.basis.glb
│   └── vBMLrTe4uLA.basis.navmesh
├── 00838-kJJyRFXVpx2
│   ├── kJJyRFXVpx2.basis.glb
│   └── kJJyRFXVpx2.basis.navmesh
├── 00839-zt1RVoi7PcG
│   ├── zt1RVoi7PcG.basis.glb
│   ├── zt1RVoi7PcG.basis.navmesh
│   ├── zt1RVoi7PcG.semantic.glb
│   └── zt1RVoi7PcG.semantic.txt
├── 00840-z9YwN9M8FpG
│   ├── z9YwN9M8FpG.basis.glb
│   └── z9YwN9M8FpG.basis.navmesh
├── 00841-SByzJLxpRGn
│   ├── SByzJLxpRGn.basis.glb
│   └── SByzJLxpRGn.basis.navmesh
├── 00842-hkr2MGpHD6B
│   ├── hkr2MGpHD6B.basis.glb
│   └── hkr2MGpHD6B.basis.navmesh
├── 00843-DYehNKdT76V
│   ├── DYehNKdT76V.basis.glb
│   ├── DYehNKdT76V.basis.navmesh
│   ├── DYehNKdT76V.semantic.glb
│   └── DYehNKdT76V.semantic.txt
├── 00844-q5QZSEeHe5g
│   ├── q5QZSEeHe5g.basis.glb
│   ├── q5QZSEeHe5g.basis.navmesh
│   ├── q5QZSEeHe5g.semantic.glb
│   └── q5QZSEeHe5g.semantic.txt
├── 00845-c3WKCnkEdha
│   ├── c3WKCnkEdha.basis.glb
│   └── c3WKCnkEdha.basis.navmesh
├── 00846-LNg5mXe1BDj
│   ├── LNg5mXe1BDj.basis.glb
│   └── LNg5mXe1BDj.basis.navmesh
├── 00847-bCPU9suPUw9
│   ├── bCPU9suPUw9.basis.glb
│   ├── bCPU9suPUw9.basis.navmesh
│   ├── bCPU9suPUw9.semantic.glb
│   └── bCPU9suPUw9.semantic.txt
├── 00848-ziup5kvtCCR
│   ├── ziup5kvtCCR.basis.glb
│   ├── ziup5kvtCCR.basis.navmesh
│   ├── ziup5kvtCCR.semantic.glb
│   └── ziup5kvtCCR.semantic.txt
├── 00849-a8BtkwhxdRV
│   ├── a8BtkwhxdRV.basis.glb
│   ├── a8BtkwhxdRV.basis.navmesh
│   ├── a8BtkwhxdRV.semantic.glb
│   └── a8BtkwhxdRV.semantic.txt
├── 00850-W7k2QWzBrFY
│   ├── W7k2QWzBrFY.basis.glb
│   └── W7k2QWzBrFY.basis.navmesh
├── 00851-YRUkbU5xsYj
│   ├── YRUkbU5xsYj.basis.glb
│   └── YRUkbU5xsYj.basis.navmesh
├── 00852-T6nG3E2Uui9
│   ├── T6nG3E2Uui9.basis.glb
│   └── T6nG3E2Uui9.basis.navmesh
├── 00853-5cdEh9F2hJL
│   ├── 5cdEh9F2hJL.basis.glb
│   ├── 5cdEh9F2hJL.basis.navmesh
│   ├── 5cdEh9F2hJL.semantic.glb
│   └── 5cdEh9F2hJL.semantic.txt
├── 00854-SiKqEZx7Ejt
│   ├── SiKqEZx7Ejt.basis.glb
│   └── SiKqEZx7Ejt.basis.navmesh
├── 00855-c5eTyR3Rxyh
│   ├── c5eTyR3Rxyh.basis.glb
│   └── c5eTyR3Rxyh.basis.navmesh
├── 00856-FnSn2KSrALj
│   ├── FnSn2KSrALj.basis.glb
│   └── FnSn2KSrALj.basis.navmesh
├── 00857-L53DsRRk4Ch
│   ├── L53DsRRk4Ch.basis.glb
│   └── L53DsRRk4Ch.basis.navmesh
├── 00858-cYkrGrCg2kB
│   ├── cYkrGrCg2kB.basis.glb
│   └── cYkrGrCg2kB.basis.navmesh
├── 00859-3t8DB4Uzvkt
│   ├── 3t8DB4Uzvkt.basis.glb
│   └── 3t8DB4Uzvkt.basis.navmesh
├── 00860-RJaJt8UjXav
│   ├── RJaJt8UjXav.basis.glb
│   └── RJaJt8UjXav.basis.navmesh
├── 00861-GLAQ4DNUx5U
│   ├── GLAQ4DNUx5U.basis.glb
│   ├── GLAQ4DNUx5U.basis.navmesh
│   ├── GLAQ4DNUx5U.semantic.glb
│   └── GLAQ4DNUx5U.semantic.txt
├── 00862-LT9Jq6dN3Ea
│   ├── LT9Jq6dN3Ea.basis.glb
│   ├── LT9Jq6dN3Ea.basis.navmesh
│   ├── LT9Jq6dN3Ea.semantic.glb
│   └── LT9Jq6dN3Ea.semantic.txt
├── 00863-b28CWbpQvor
│   ├── b28CWbpQvor.basis.glb
│   └── b28CWbpQvor.basis.navmesh
├── 00864-QHhQZWdMpGJ
│   ├── QHhQZWdMpGJ.basis.glb
│   └── QHhQZWdMpGJ.basis.navmesh
├── 00865-fsQtJ8t3nTf
│   ├── fsQtJ8t3nTf.basis.glb
│   └── fsQtJ8t3nTf.basis.navmesh
├── 00866-XNeHsjL6nBB
│   ├── XNeHsjL6nBB.basis.glb
│   └── XNeHsjL6nBB.basis.navmesh
├── 00867-uLz9jNga3kC
│   ├── uLz9jNga3kC.basis.glb
│   └── uLz9jNga3kC.basis.navmesh
├── 00868-vd3HHTEpmyA
│   ├── vd3HHTEpmyA.basis.glb
│   └── vd3HHTEpmyA.basis.navmesh
├── 00869-MHPLjHsuG27
│   ├── MHPLjHsuG27.basis.glb
│   ├── MHPLjHsuG27.basis.navmesh
│   ├── MHPLjHsuG27.semantic.glb
│   └── MHPLjHsuG27.semantic.txt
├── 00870-AYpsNQsWncn
│   ├── AYpsNQsWncn.basis.glb
│   └── AYpsNQsWncn.basis.navmesh
├── 00871-VBzV5z6i1WS
│   ├── VBzV5z6i1WS.basis.glb
│   ├── VBzV5z6i1WS.basis.navmesh
│   ├── VBzV5z6i1WS.semantic.glb
│   └── VBzV5z6i1WS.semantic.txt
├── 00872-F7EAMsdDASd
│   ├── F7EAMsdDASd.basis.glb
│   └── F7EAMsdDASd.basis.navmesh
├── 00873-bxsVRursffK
│   ├── bxsVRursffK.basis.glb
│   ├── bxsVRursffK.basis.navmesh
│   ├── bxsVRursffK.semantic.glb
│   └── bxsVRursffK.semantic.txt
├── 00874-uSKXQ5fFg6u
│   ├── uSKXQ5fFg6u.basis.glb
│   └── uSKXQ5fFg6u.basis.navmesh
├── 00875-66seV3BWPoX
│   ├── 66seV3BWPoX.basis.glb
│   └── 66seV3BWPoX.basis.navmesh
├── 00876-mv2HUxq3B53
│   ├── mv2HUxq3B53.basis.glb
│   ├── mv2HUxq3B53.basis.navmesh
│   ├── mv2HUxq3B53.semantic.glb
│   └── mv2HUxq3B53.semantic.txt
├── 00877-4ok3usBNeis
│   ├── 4ok3usBNeis.basis.glb
│   ├── 4ok3usBNeis.basis.navmesh
│   ├── 4ok3usBNeis.semantic.glb
│   └── 4ok3usBNeis.semantic.txt
├── 00878-XB4GS9ShBRE
│   ├── XB4GS9ShBRE.basis.glb
│   ├── XB4GS9ShBRE.basis.navmesh
│   ├── XB4GS9ShBRE.semantic.glb
│   └── XB4GS9ShBRE.semantic.txt
├── 00879-7Ukhou1GxYi
│   ├── 7Ukhou1GxYi.basis.glb
│   └── 7Ukhou1GxYi.basis.navmesh
├── 00880-Nfvxx8J5NCo
│   ├── Nfvxx8J5NCo.basis.glb
│   ├── Nfvxx8J5NCo.basis.navmesh
│   ├── Nfvxx8J5NCo.semantic.glb
│   └── Nfvxx8J5NCo.semantic.txt
├── 00881-u1bkiGRVyu9
│   ├── u1bkiGRVyu9.basis.glb
│   └── u1bkiGRVyu9.basis.navmesh
├── 00882-rXXL6twQiWc
│   ├── rXXL6twQiWc.basis.glb
│   └── rXXL6twQiWc.basis.navmesh
├── 00883-u8ug2rtNARf
│   ├── u8ug2rtNARf.basis.glb
│   └── u8ug2rtNARf.basis.navmesh
├── 00884-XMHNu9rRQ1y
│   ├── XMHNu9rRQ1y.basis.glb
│   └── XMHNu9rRQ1y.basis.navmesh
├── 00885-dVW2D7TDctW
│   ├── dVW2D7TDctW.basis.glb
│   └── dVW2D7TDctW.basis.navmesh
├── 00886-TPhiubUHKcP
│   ├── TPhiubUHKcP.basis.glb
│   └── TPhiubUHKcP.basis.navmesh
├── 00887-hyFzGGJCSYs
│   ├── hyFzGGJCSYs.basis.glb
│   └── hyFzGGJCSYs.basis.navmesh
├── 00888-hDBqLgydy1n
│   ├── hDBqLgydy1n.basis.glb
│   └── hDBqLgydy1n.basis.navmesh
├── 00889-HMkoS756sz6
│   ├── HMkoS756sz6.basis.glb
│   └── HMkoS756sz6.basis.navmesh
├── 00890-6s7QHgap2fW
│   ├── 6s7QHgap2fW.basis.glb
│   ├── 6s7QHgap2fW.basis.navmesh
│   ├── 6s7QHgap2fW.semantic.glb
│   └── 6s7QHgap2fW.semantic.txt
├── 00891-cvZr5TUy5C5
│   ├── cvZr5TUy5C5.basis.glb
│   ├── cvZr5TUy5C5.basis.navmesh
│   ├── cvZr5TUy5C5.semantic.glb
│   └── cvZr5TUy5C5.semantic.txt
├── 00892-bzCsHPLDztK
│   ├── bzCsHPLDztK.basis.glb
│   └── bzCsHPLDztK.basis.navmesh
├── 00893-yZME6UR9dUN
│   ├── yZME6UR9dUN.basis.glb
│   └── yZME6UR9dUN.basis.navmesh
├── 00894-HY1NcmCgn3n
│   ├── HY1NcmCgn3n.basis.glb
│   ├── HY1NcmCgn3n.basis.navmesh
│   ├── HY1NcmCgn3n.semantic.glb
│   └── HY1NcmCgn3n.semantic.txt
├── 00895-auFeVz9Go4m
│   ├── auFeVz9Go4m.basis.glb
│   └── auFeVz9Go4m.basis.navmesh
├── 00896-5hGmubEE6ZF
│   ├── 5hGmubEE6ZF.basis.glb
│   └── 5hGmubEE6ZF.basis.navmesh
├── 00897-LEFTm3JecaC
│   ├── LEFTm3JecaC.basis.glb
│   └── LEFTm3JecaC.basis.navmesh
├── 00898-8CRYizAb6yd
│   ├── 8CRYizAb6yd.basis.glb
│   └── 8CRYizAb6yd.basis.navmesh
├── 00899-58NLZxWBSpk
│   ├── 58NLZxWBSpk.basis.glb
│   └── 58NLZxWBSpk.basis.navmesh
├── hm3d_annotated_basis.scene_dataset_config.json
└── hm3d_annotated_val_basis.scene_dataset_config.json

I changed the path in OpenFMNav/envs/habitat/configs/tasks/objectnav_hm3d.yaml

More on that, when running your command for inference, the first scene to be loaded is 4ok3usBNeis
which contains

00877-4ok3usBNeis
│   ├── 4ok3usBNeis.basis.glb
│   ├── 4ok3usBNeis.basis.navmesh
│   ├── 4ok3usBNeis.semantic.glb
│   └── 4ok3usBNeis.semantic.txt

but during loading

[11:28:52:201771]:[Sim] Simulator.cpp(432)::instanceStageForSceneAttributes : Successfully loaded stage named : [path]/hm3d_sem/hm3d_v0.2/val/00877-4ok3usBNeis/4ok3usBNeis.basis.glb
[11:28:52:201823]:[Sim] Simulator.cpp(464)::instanceStageForSceneAttributes : 
---
The active scene does not contain semantic annotations : activeSemanticSceneID_ = 0  
---

Finally, I found the problem. I was loading the scene dataset from HDD, so I changed the scene dataset path from OpenFMNav/envs/habitat/configs/tasks/objectnav_hm3d.yaml.

This is fine to do. However, habitat expects that the file
hm3d_annotated_basis.scene_dataset_config.json and hm3d_val_basis.scene_dataset_config.json must be present in data/scene_datasets/hm3d_v0.2. Or, at least, I didn't find a way to also override these files.

To sum up, after symlinking hm3d_annotated_basis.scene_dataset_config.json and hm3d_val_basis.scene_dataset_config.json to data/scene_datasets/hm3d_v0.2 the code works fine.

Explain in detail here.