devendrachaplot / Neural-SLAM

Pytorch code for ICLR-20 Paper "Learning to Explore using Active Neural SLAM"
http://www.cs.cmu.edu/~dchaplot/projects/neural-slam.html
MIT License
760 stars 144 forks source link

AttributeError: module 'env' has no attribute 'habitat' #23

Closed XYZ-99 closed 3 years ago

XYZ-99 commented 3 years ago

I installed the environment according to README.md:

conda create -n Neural-SLAM python=3.6;     # for creating a conda environment
conda activate Neural-SLAM;                 # for conda
git clone https://github.com/facebookresearch/habitat-sim.git;
cd habitat-sim; git checkout 9575dcd45fe6f55d2a44043833af08972a7895a9;
pip install -r requirements.txt;
python setup.py install --headless;         # output: Successfully installed magnum-0.0.0
cd ..;                                      # back to the parent directory
git clone https://github.com/facebookresearch/habitat-api.git;
cd habitat-api; git checkout b5f2b00a25627ecb52b43b13ea96b05998d9a121;
pip install -e .;                           # output: Successfully installed PyYAML-5.3.1 chardet-4.0.0 gym-0.10.9 habitat idna-2.10 imageio-2.9.0 imageio-ffmpeg-0.4.2 opencv-python-4.4.0.46 pyglet-1.5.13 requests-2.25.1 scipy-1.5.4 six-1.15.0 urllib3-1.26.2 yacs-0.1.8
cd ..;                                      # back to the parent directory
conda install pytorch==1.2.0 torchvision cudatoolkit=10.0 -c pytorch;
git clone --recurse-submodules https://github.com/devendrachaplot/Neural-SLAM;
cd Neural-SLAM;
pip install -r requirements.txt;            # output: Successfully installed PyWavelets-1.1.1 absl-py-0.11.0 cachetools-4.2.0 cycler-0.10.0 decorator-4.4.2 google-auth-1.24.0 google-auth-oauthlib-0.4.2 grpcio-1.34.0 imageio-2.6.0 importlib-metadata-3.3.0 joblib-1.0.0 kiwisolver-1.3.1 markdown-3.3.3 matplotlib-3.3.3 networkx-2.5 oauthlib-3.1.0 pandas-1.1.5 protobuf-3.14.0 pyasn1-0.4.8 pyasn1-modules-0.2.8 pyparsing-2.4.7 python-dateutil-2.8.1 pytz-2020.5 requests-oauthlib-1.3.0 rsa-4.6 scikit-fmm-2019.1.30 scikit-image-0.15.0 scikit-learn-0.22.2.post1 seaborn-0.9.0 tensorboard-2.4.0 tensorboard-plugin-wit-1.7.0 typing-extensions-3.7.4.3 werkzeug-1.0.1 zipp-3.4.0
python main.py -n1 --auto_gpu_config 0 --split val;

An error then occurred:

Traceback (most recent call last):
  File "main.py", line 15, in <module>
    from env import make_vec_envs
  File "xxx/Neural-SLAM/env/__init__.py", line 3, in <module>
    from .habitat import construct_envs
  File "xxx/Neural-SLAM/env/habitat/__init__.py", line 9, in <module>
    from .exploration_env import Exploration_Env
  File "xxx/Neural-SLAM/env/habitat/exploration_env.py", line 29, in <module>
    import env.habitat.utils.pose as pu
AttributeError: module 'env' has no attribute 'habitat'

Are there any extra commands that I have missed?

devendrachaplot commented 3 years ago

I believe this is some bug in python 3.6 as I described in this issue here: https://github.com/devendrachaplot/Neural-SLAM/issues/1#issuecomment-616630502

If you update the python version to 3.7, this issue should be resolved.

umerhasan17 commented 3 years ago

@devendrachaplot if I update the python version to 3.7 the habitat-sim version you advertise is not compatible. I am using release 0.1.4. Would it be possible to use a later habitat release with your code?

habitat-sim=0.1.4 -> python[version='>=3.6,<3.7.0a0']

umerhasan17 commented 3 years ago

@devendrachaplot Unfortunately, habitat-sim=0.1.5 also requires python 3.6

Unfortunately, I cannot see how to use python 3.7 as a workaround since the datasets require python 3.6. How did you implement this with the existing bugs in python 3.6 previously?