one4all 排坑记录
- 任务
- 踩坑回顾
- 动作
- 踩坑
- 动作
- 踩坑
- 动作
- 新一步
- 测试Habitat-sim
- 测试habitat-lab
- 继续ONE4ALL
任务
看了《One-4-All: Neural Potential Fields for Embodied Navigation》这篇论文,感觉挺有意思,他也开源了代码。视觉语言导航是我一直想做的事情,这个项目用的也是Habitat这个仿真环境,我看很多做VLN的都用这个环境。尝试复现这个项目,然后搞清楚Habitat环境是怎么回事。
踩坑回顾
没有说的,就是按照原项目readme做的
动作
- 照例,新建文件夹,然后git clone
- readme说用venv创建虚拟环境,但我习惯用conda了,所以:
conda create -n ONE4ALL python=3.10
conda activate ONE4ALL
踩坑
安装依赖时:
pip3 install -r requirements.txt
报错:
Running command git clone --filter=blob:none --quiet https://github.com/facebookincubator/submitit /tmp/pip-install-l7el9026/submitit_2fc7c3624f664ace92cc27ec82088ad7fatal: 无法访问 'https://github.com/facebookincubator/submitit/':gnutls_handshake() failed: Error in the pull function.error: subprocess-exited-with-error× git clone --filter=blob:none --quiet https://github.com/facebookincubator/submitit /tmp/pip-install-l7el9026/submitit_2fc7c3624f664ace92cc27ec82088ad7 did not run successfully.│ exit code: 128╰─> See above for output.note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error× git clone --filter=blob:none --quiet https://github.com/facebookincubator/submitit /tmp/pip-install-l7el9026/submitit_2fc7c3624f664ace92cc27ec82088ad7 did not run successfully.
│ exit code: 128
╰─> See above for output.note: This error originates from a subprocess, and is likely not a problem with pip.
这种问题常遇到,一般是git的代理设置问题,但检查后发现没问题,再次运行,报错:
Looking in indexes: https://pypi.org/simple, https://download.pytorch.org/whl/cu113
Collecting submitit (from -r requirements.txt (line 6))Cloning https://github.com/facebookincubator/submitit (to revision escape_all) to /tmp/pip-install-4zalxp9i/submitit_20dd99e9b81e4548b972292505b58f6eRunning command git clone --filter=blob:none --quiet https://github.com/facebookincubator/submitit /tmp/pip-install-4zalxp9i/submitit_20dd99e9b81e4548b972292505b58f6eWARNING: Did not find branch or tag 'escape_all', assuming revision or ref.Running command git checkout -q escape_allerror: 路径规格 'escape_all' 未匹配任何 git 已知文件error: subprocess-exited-with-error× git checkout -q escape_all did not run successfully.│ exit code: 1╰─> See above for output.note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error× git checkout -q escape_all did not run successfully.
│ exit code: 1
╰─> See above for output.note: This error originates from a subprocess, and is likely not a problem with pip.
问题在于找不到escape_all这个分支。打开submitit这个项目,发现里面确实没有这个分支。我尝试不指定分支,把requirements命令改为:
git+https://github.com/facebookincubator/submitit#egg=submitit
这个问题没有报错,如果以后出问题,可能就出在这里的版本不对。真实的为啥非要用实验的分支,用稳定的多好。
然后又遇到了其他包的版本错误:
Collecting matplotlib==3.5.1 (from -r requirements.txt (line 16))Downloading matplotlib-3.5.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (6.7 kB)
ERROR: Could not find a version that satisfies the requirement numpy==1.22.2 (from versions: 1.24.1, 1.26.3)
ERROR: No matching distribution found for numpy==1.22.2
尝试不指定版本:
pip3 install matplotlib
报错,但是成功安装了:
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
vcstools 0.1.42 requires pyyaml, which is not installed.
wstool 0.1.17 requires pyyaml, which is not installed.
Successfully installed contourpy-1.2.0 cycler-0.12.1 fonttools-4.49.0 kiwisolver-1.4.5 matplotlib-3.8.3 numpy-1.26.4 packaging-23.2 pillow-10.2.0 pyparsing-3.1.1 python-dateutil-2.8.2 six-1.16.0
那就按照提示,补充安装:
pip3 install pyyaml catkin-pkg roskpkg
最后报错:
ERROR: Could not find a version that satisfies the requirement roskpkg (from versions: none)
ERROR: No matching distribution found for roskpkg
找不到就找不到吧,可能也用不到。
继续按照readme手动安装剩下的,不再指定版本了:
pip3 install numpy Pillow pytorch-lightning protobuf scikit-image scipy torch torchvision setuptools pykeops seaborn tensorflow-gpu tensorflow-probability einops prettytable tqdm imageio-ffmpeg
然后torch竟然找不到版本了:
ERROR: Ignored the following versions that require a different python version: 1.6.2 Requires-Python >=3.7,<3.10; 1.6.3 Requires-Python >=3.7,<3.10; 1.7.0 Requires-Python >=3.7,<3.10; 1.7.1 Requires-Python >=3.7,<3.10
ERROR: Could not find a version that satisfies the requirement torch (from versions: none)
ERROR: No matching distribution found for torch
然后我把环境删了重建,一个个包手动install,几乎所有的包都没问题了,只有tensorflow-gpu顽固不化!
Specifications:- tensorflow-gpu -> python[version='2.7.*|3.6.*|3.7.*|3.8.*|3.9.*|3.5.*|>=3.5,<3.6.0a0|>=3.6,<3.7.0a0|>=2.7,<2.8.0a0']Your python: python=3.10
难道只能新建一个低版本python环境,重新安装包了吗?我不服气,网上搜下,看有没有新的希望。宁猜怎么着?还真有!参考博客说,tensorflow2.9适配python3.10.我一看requirements,人家本来就要求的tensorflow-gpu==2.9.1
。于是我顺理成章地运行:
pip3 install tensorflow-gpu==2.9.1
解决!
全过程:
pip3 install empy rospkg pyyaml catkin_pkg
pip3 install submitit hydra-submitit-launcher
pip3 install torch torchvision
pip3 install pandas albumentations networkx rich hydra-core hydra-colorlog
pip3 install hydra_optuna_sweeper scikit-learn comet_ml gym imageio matplotlib numpy Pillow pytorch-lightning protobuf scikit-image scipy
pip3 install setuptools pykeops seaborn einops prettytable tqdm imageio-ffmpeg
pip3 install tensorflow-probability
pip3 install tensorflow-gpu==2.9.1
动作
按照readme执行:
pip3 install geomloss
踩坑
readme中的:
cd mazelab
pip3 install -e .
export PYTHONPATH=<path_to>/one4all/:$PYTHONPATH
让我摸不到头脑,明明没有cd mazelab这个目录啊。我一搜,哦,原来有个mazelab的python项目,是用来生成迷宫的:mazelab项目
于是,新建一个目录,进入目录,查看requirements里面的东西我的环境里都有了,然后按照mazelab的readme执行:
pip3 install -e .
于是顺利安装成功:Successfully installed mazelab-0.2.0
动作
按照readme指示,查看cmake版本:
cmake --version
我是:cmake version 3.22.1
,满足大于3.10了。
接下来是要安装Habiat了,包含Habitat-sim和Habitat-lab,他都用的源码安装。我看meta的官方仓库,Habitat-sim推荐用conda安装,Habitat-lab要clone下来安装。我头铁,就要按官方的来!
对于Habitat-sim的conda安装,meta给了这么几种选择:
比较一下发现,基本都是一样的,只有两个区别:如果要bullet,就加上withbullet,如果没有显示器,就加上headless。我有显示器,然后看原本要源码安装的语句python setup.py --bullet --with-cuda build_ext --parallel 8 install --cmake-args="-DUSE_SYSTEM_ASSIMP=ON"
也有bullet的字眼,最后habitat-lab的安装要求中也要求执行conda install habitat-sim withbullet -c conda-forge -c aihabitat
,于是我选择执行:
conda install habitat-sim withbullet -c conda-forge -c aihabitat
结果是他一直卡在种地方循环,我只能结束掉他:
Collecting package metadata (current_repodata.json): done
Solving environment: unsuccessful initial attempt using frozen solve. Retrying with flexible solve.
Solving environment: unsuccessful attempt using repodata from current_repodata.json, retrying with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: unsuccessful initial attempt using frozen solve. Retrying with flexible solve.
似乎是环境不对,和其他包不兼容。我按照官网要求,建个环境试一试:
conda create -n habitat python=3.9 cmake=3.14.0
conda activate habitat
conda install habitat-sim withbullet -c conda-forge -c aihabitat
发现没有任何问题。那在我的环境里不行,有3中可能:
- cmake的原因
- python3.10的原因
- 其他包的原因
我决定删掉官方环境,新建一个3.10,不指定cmake的环境:
conda create -n habitat python=3.10
conda activate habitat
conda install habitat-sim withbullet -c conda-forge -c aihabitat
发现不行。说明大概率是python3.10或者cmake问题。
我再进行这个尝试:
conda create -n habitat python=3.10 cmake=3.14.0
conda activate habitat
conda install habitat-sim withbullet -c conda-forge -c aihabitat
发现还是不行。可能和cmake没关系?得要python3.9才行?
再试试python3.9,不指定cmake的:
conda create -n habitat python=3.9
conda activate habitat
conda install habitat-sim withbullet -c conda-forge -c aihabitat
发现没问题。。。还真得python3.9啊。。。
算了我git下来安装!我就不退版本!
按照readme来,执行到
pip3 install -r requirements.txt
基本没问题,有一个版本报错:
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
albumentations 1.4.0 requires numpy>=1.24.4, but you have numpy 1.23.5 which is incompatible.
重新安装这个版本就行:
pip3 install numpy==1.24.4
然后关键一步:
python setup.py --bullet --with-cuda build_ext --parallel 8 install --cmake-args="-DUSE_SYSTEM_ASSIMP=ON"
成功!没有报错。
安装Habitat-Lab,前几步没事,到最后一步出错:
python setup.py develop --all
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]or: setup.py --help [cmd1 cmd2 ...]or: setup.py --help-commandsor: setup.py cmd --helperror: option --allow-hosts requires argument
按照chatgpt的指示,我运行:
python setup.py develop --all --allow-hosts=*
成功
发现之前没有测试,测试下:
python -m habitat_sim.utils.datasets_download --uids habitat_test_scenes --data-path /home/lcy-magic/VLN_TEST/Habitat_data
报错:
git:'lfs' 不是一个 git 命令。参见 'git --help'
chatgpt说这是没安装Git LFS,于是安装:
sudo apt install git-lfs
git lfs install
再次运行:
python -m habitat_sim.utils.datasets_download --uids habitat_test_scenes --data-path /home/lcy-magic/VLN_TEST/Habitat_data
报错:
stderr: 'fatal: unable to access 'https://huggingface.co/datasets/ai-habitat/habitat_test_scenes.git/': gnutls_handshake() failed: Error in the pull function.'
参照chatgpt的提示执行:
git remote set-url origin git@huggingface.co:datasets/ai-habitat/habitat_test_scenes.git
然后再下载就没问题了。
执行这个语句时候又出错了:
python examples/viewer.py --scene /home/lcy-magic/VLN_TEST/Habitat_data/scene_datasets/habitat-test-scenes/skokloster-castle.glb
报错:
EGL: Failed to get EGL display: Success
Platform::GlfwApplication::tryCreate(): cannot create a window with core OpenGL context, falling back to compatibility context
EGL: Failed to get EGL display: Success
Platform::GlfwApplication::tryCreate(): cannot create a window with OpenGL context
可是运行这个就没问题:
./build/viewer /home/lcy-magic/VLN_TEST/Habitat_data/scene_datasets/habitat-test-scenes/skokloster-castle.glb
有人遇到了相同的问题,发了issue:参考issue。太长了,明天再看。
首先,我把原来的数据库删了,重新在默认位置下载了,因为改语句麻烦,然后开始看issue排查问题:
首先检查安装GLVND,他是一个用于管理OpenGL的函数库:
sudo apt install libglvnd-dev
glxinfo | grep OpenGL
发现我安装好了,没问题。但是intel的,可能是这个问题:
OpenGL vendor string: Intel
OpenGL renderer string: Mesa Intel(R) Graphics (ADL GT2)
OpenGL core profile version string: 4.6 (Core Profile) Mesa 21.2.6
OpenGL core profile shading language version string: 4.60
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.6 (Compatibility Profile) Mesa 21.2.6
OpenGL shading language version string: 4.60
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 21.2.6
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
OpenGL ES profile extensions:
这篇博客参考博客说,可以用Bumblebee切换显卡。安装Bumblebee,N卡驱动,并进行配置:
sudo apt install bumblebee primus nvidia-prime
sudo gedit /etc/bumblebee/bumblebee.conf
把配置改为:
Driver=nvidia
重启bumblebee服务:
sudo systemctl restart bumblebeed
执行完后等一会儿,我就是太急了直接强制关机,导致驱动掉了,进不去图形界面。最后是ctrl+alt+fn+f2进入tty界面,然后安装了525版本驱动再重启才好的(我用推荐的驱动没有用,最后看别人用525我也试一试没想到解决了)。
然后我重启,好像没用,而且我的笔记本外接显示器也不识别了,然后我又运行了:
sudo prime-select nvidia
再次重启,两个显示器都正常显示了,而且:
可能就是应该用这个语句,感谢这个博客参考博客
如果要换回核显,就:sudo prime-select intel
不知道有没有,随时指定用哪种显卡的方式。
这时候再回去运行:
./build/viewer /home/lcy-magic/VLN_TEST/habitat-sim/data/scene_datasets/habitat-test-scenes/skokloster-castle.glb
python examples/viewer.py --scene /home/lcy-magic/VLN_TEST/habitat-sim/data/scene_datasets/habitat-test-scenes/skokloster-castle.glb
新一步
接下来要生成数据和训练了。原文说:
We’ll use the Habitat simulator for data generation and navigation. You first need to download the relevant scenes (at least Annawan) from the official Gibson repositiory. Make sure to put the relevant .glb and .navmesh files under the data_habitat/versioned_data/habitat_test_scenes_1.0 directory.
我就填了PDF表,提交上去,然后下载了最小的那个给habitat的数据集。后面遇到了很多波折,运行不起来。还是先验证着仿真环境吧,说不定是这里面的问题。
测试Habitat-sim
前面测试过这俩没问题:
/home/lcy-magic/VLN_TEST/habitat-sim/build/viewer /home/lcy-magic/VLN_TEST/habitat-sim/data/scene_datasets/habitat-test-scenes/skokloster-castle.glb
python /home/lcy-magic/VLN_TEST/habitat-sim/examples/viewer.py --scene /home/lcy-magic/VLN_TEST/habitat-sim/data/scene_datasets/habitat-test-scenes/skokloster-castle.glb
然后物理交互测试:
python -m habitat_sim.utils.datasets_download --uids replica_cad_dataset
/home/lcy-magic/VLN_TEST/habitat-sim/build/viewer /home/lcy-magic/VLN_TEST/habitat-sim/data/scene_datasets/habitat-test-scenes/skokloster-castle.glb
python /home/lcy-magic/VLN_TEST/habitat-sim/src_python/habitat_sim/utils/datasets_download.py --uids replica_cad_dataset
/home/lcy-magic/VLN_TEST/habitat-sim/build/viewer --enable-physics --dataset /home/lcy-magic/VLN_TEST/habitat-sim/data/replica_cad/replicaCAD.scene_dataset_config.json -- apt_1
python /home/lcy-magic/VLN_TEST/habitat-sim/examples/viewer.py --dataset /home/lcy-magic/VLN_TEST/habitat-sim/data/replica_cad/replicaCAD.scene_dataset_config.json --scene apt_1
没问题
测试非交互式:
python /home/lcy-magic/VLN_TEST/habitat-sim/examples/example.py --scene /home/lcy-magic/VLN_TEST/habitat-sim/data/scene_datasets/habitat-test-scenes/skokloster-castle.glb
测试benchmark:
数据可以这么获取:
wget http://dl.fbaipublicfiles.com/habitat/mp3d_example.zip
执行:
python /home/lcy-magic/VLN_TEST/habitat-sim/examples/benchmark.py --scene /home/lcy-magic/VLN_TEST/habitat-sim/data/mp3d_example/17DRP5sb8fy/17DRP5sb8fy.glb
报错:
---------------------- rgb ------------------------
Traceback (most recent call last):File "/home/lcy-magic/VLN_TEST/habitat-sim/examples/benchmark.py", line 120, in <module>perf[key] = demo_runner.benchmark(settings)File "/home/lcy-magic/VLN_TEST/habitat-sim/examples/demo_runner.py", line 395, in benchmarkperfs = pool.map(self._bench_target, range(nprocs))File "/home/lcy-magic/anaconda3/envs/ONE4ALL/lib/python3.10/multiprocessing/pool.py", line 367, in mapreturn self._map_async(func, iterable, mapstar, chunksize).get()File "/home/lcy-magic/anaconda3/envs/ONE4ALL/lib/python3.10/multiprocessing/pool.py", line 774, in getraise self._valueFile "/home/lcy-magic/anaconda3/envs/ONE4ALL/lib/python3.10/multiprocessing/pool.py", line 540, in _handle_tasksput(task)File "/home/lcy-magic/anaconda3/envs/ONE4ALL/lib/python3.10/multiprocessing/connection.py", line 206, in sendself._send_bytes(_ForkingPickler.dumps(obj))File "/home/lcy-magic/anaconda3/envs/ONE4ALL/lib/python3.10/multiprocessing/reduction.py", line 51, in dumpscls(buf, protocol).dump(obj)
TypeError: cannot pickle '_magnum.Color4' object
而运行:
python /home/lcy-magic/VLN_TEST/habitat-sim/examples/example.py --scene /home/lcy-magic/VLN_TEST/habitat-sim/data/mp3d_example/17DRP5sb8fy/17DRP5sb8fy.glb
python /home/lcy-magic/VLN_TEST/habitat-sim/examples/example.py --scene /home/lcy-magic/VLN_TEST/habitat-sim/data/mp3d_example/17DRP5sb8fy/17DRP5sb8fy.glb --enable_physics
是没问题的。害又卡在这里了。
测试habitat-lab
运行:
python /home/lcy-magic/VLN_TEST/habitat-lab/examples/example.py
没问题。中间遇到了以前遇到过的问题,老办法解决就行:
运行:
python /home/lcy-magic/VLN_TEST/habitat-lab/examples/interactive_play.py --never-end
提示我没有Pygame,安装:
pip3 install pygame
运行后又说我没有Pybullet,安装:
pip3 install pybullet
再运行,还是有报错:
X Error of failed request: BadAccess (attempt to access private resource denied)Major opcode of failed request: 152 (GLX)Minor opcode of failed request: 5 (X_GLXMakeCurrent)Serial number of failed request: 178Current serial number in output stream: 178
habitat-lab的readme说:
Note: Interactive testing currently fails on Ubuntu 20.04 with an error: X Error of failed request: BadAccess (attempt to access private resource denied). We are working on fixing this, and will update instructions once we have a fix. The script works without errors on MacOS.
麻了,看来近期没戏了。
继续ONE4ALL
想直接跳到navigation看效果,按reame指示下载,并整理目录。
下载下来是个压缩包,解压后就叫components,正是他要的目录。但是原本这个项目就有一个这个目录。原本的目录是空的,我把新下载的替换掉他。乍一看和readme要求的不一样:
components
└── habitat├── backbone.ckpt├── fk.ckpt└── geodesic_regressors├── annawan.ckpt...
但你要用tree命令查看,发现是一样的:
./components/
├── habitat
│ ├── backbone.ckpt
│ ├── fd.ckpt
│ └── geodesic_regressors
│ ├── aloha.ckpt
│ ├── annawan.ckpt
│ ├── cantwell.ckpt
│ ├── dunmor.ckpt
│ ├── eastville.ckpt
│ ├── hambleton.ckpt
│ ├── nicut.ckpt
│ └── sodaville.ckpt
└── jackal├── backbone.ckpt├── backbone_finetuned.ckpt├── fd.ckpt└── gr.ckpt3 directories, 14 files
接下来运行:
ython /home/lcy-magic/VLN_TEST/one4all/run_habitat.py policy=habitat_o4a env=habitat sim_env=Annawan difficulty=hard test_params.n_trajectories=10
报错:
Traceback (most recent call last):File "/home/lcy-magic/VLN_TEST/one4all/run_habitat.py", line 10, in mainfrom src.run_habitat import run_habitatFile "/home/lcy-magic/VLN_TEST/one4all/src/run_habitat.py", line 17, in <module>from src import utilsFile "/home/lcy-magic/VLN_TEST/one4all/src/utils/__init__.py", line 146, in <module>logger: List[pl.loggers.LightningLoggerBase],
AttributeError: module 'pytorch_lightning.loggers' has no attribute 'LightningLoggerBase'Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.
糟糕,看似是pytorch_lightning版本问题。
看requirements要求的是1.6.0,结果我的:
pip3 show pytorch_lightning
是2.2.0的。
Name: pytorch-lightning
Version: 2.2.0.post0
Summary: PyTorch Lightning is the lightweight PyTorch wrapper for ML researchers. Scale your models. Write less boilerplate.
Home-page: https://github.com/Lightning-AI/lightning
Author: Lightning AI et al.
Author-email: pytorch@lightning.ai
License: Apache-2.0
Location: /home/lcy-magic/anaconda3/envs/ONE4ALL/lib/python3.10/site-packages
Requires: fsspec, lightning-utilities, numpy, packaging, PyYAML, torch, torchmetrics, tqdm, typing-extensions
Required-by:
看来要降版本了。看博客参考博客说,这个功能,1.9的版本后就没有了。我先退到指定版本吧:
pip3 install pytorch_lightning==1.6.0
然后提示可能会有问题:
DEPRECATION: pytorch-lightning 1.6.0 has a non-standard dependency specifier torch>=1.8.*. pip 24.0 will enforce this behaviour change. A possible replacement is to upgrade to a newer version of pytorch-lightning or contact the author to suggest that they release a version with a conforming dependency specifiers. Discussion can be found at https://github.com/pypa/pip/issues/12063
先测试行不行:
报错:
Error executing job with overrides: ['policy=habitat_o4a', 'env=habitat', 'sim_env=Annawan', 'difficulty=hard', 'test_params.n_trajectories=10']
Traceback (most recent call last):File "/home/lcy-magic/VLN_TEST/one4all/run_habitat.py", line 17, in mainreturn run_habitat(cfg)File "/home/lcy-magic/VLN_TEST/one4all/src/run_habitat.py", line 83, in run_habitathabitat_config = habitat.get_config(config_paths="conf_habitat/imagenav.yaml")
TypeError: get_config() got an unexpected keyword argument 'config_paths'Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.
好吧,那就给他设为1吧:
export HYDRA_FULL_ERROR=1
报错信息确实多了,但没啥有用信息,害。看代码:
habitat_config = habitat.get_config(config_paths="conf_habitat/imagenav.yaml")
再去看函数定义的头:
def get_config(config_path: str,overrides: Optional[List[str]] = None,configs_dir: str = _HABITAT_CFG_DIR,
) -> DictConfig:
看来是拼写错误,改成:
habitat_config = habitat.get_config(config_path="conf_habitat/imagenav.yaml")
再运行,开始报新的错误了。报错太长了,应该把之前的环境变量取消掉:
unset HYDRA_FULL_ERROR
再运行,报错:
Error executing job with overrides: ['policy=habitat_o4a', 'env=habitat', 'sim_env=Annawan', 'difficulty=hard', 'test_params.n_trajectories=10']
Traceback (most recent call last):File "/home/lcy-magic/VLN_TEST/one4all/run_habitat.py", line 17, in mainreturn run_habitat(cfg)File "/home/lcy-magic/VLN_TEST/one4all/src/run_habitat.py", line 83, in run_habitathabitat_config = habitat.get_config(config_path="conf_habitat/imagenav.yaml")File "/home/lcy-magic/VLN_TEST/habitat-lab/habitat-lab/habitat/config/default.py", line 131, in get_configwith lock, initialize_config_dir(File "/home/lcy-magic/anaconda3/envs/ONE4ALL/lib/python3.10/site-packages/hydra/initialize.py", line 170, in __init__Hydra.create_main_hydra2(task_name=job_name, config_search_path=csp)File "/home/lcy-magic/anaconda3/envs/ONE4ALL/lib/python3.10/site-packages/hydra/_internal/hydra.py", line 68, in create_main_hydra2GlobalHydra.instance().initialize(hydra)File "/home/lcy-magic/anaconda3/envs/ONE4ALL/lib/python3.10/site-packages/hydra/core/global_hydra.py", line 16, in initializeraise ValueError(
ValueError: GlobalHydra is already initialized, call GlobalHydra.instance().clear() if you want to re-initializeSet the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.
听起来不严重,是初始化的语句问题。修改为:
GlobalHydra.instance().clear()
habitat_config = habitat.get_config(config_path="conf_habitat/imagenav.yaml")
并在文件开头import:
from hydra.core.global_hydra import GlobalHydra
再次运行,又遇到经典问题:
File "/home/lcy-magic/VLN_TEST/habitat-lab/habitat-lab/habitat/config/default.py", line 85, in patch_configsim_config = cfg.habitat.simulator
omegaconf.errors.ConfigAttributeError: Key 'habitat' is not in structfull_key: habitatobject_type=dict
之前运行数据训练的代码就卡在这个地方,真的服了。我看网上别人的config里也都没有habitat这个key啊!
算了,我暂时放弃了,呜呜呜。因为habitat-sim的配置还不太熟悉。打算找个star、fork人多的项目,复现一下,然后学清楚habitat的使用,再回来排错,思路会清晰很多。如果有大佬知道我该怎么办,请不吝指教,谢谢。