Code Monkey home page Code Monkey logo

Comments (4)

devendrachaplot avatar devendrachaplot commented on July 21, 2024

Hi,
You need to install specific older versions of habitat-sim and habitat-api for running the Active Neural SLAM code. Check the instructions on installing dependencies in the README for specific versions:

https://github.com/devendrachaplot/Neural-SLAM/blob/master/README.md#installing-dependencies

from neural-slam.

Sunnyzhr avatar Sunnyzhr commented on July 21, 2024

@devendrachaplot Thanks for reply!
I follow the instructions, but still get a little trouble:

My Steps (before Error)

  1. Preparations
    Intructed by BuildFromSource
sudo -s
conda create -n habitat python=3.6 cmake=3.14.0
conda activate habitat
sudo apt-get update || true
sudo apt-get install -y --no-install-recommends \
     libjpeg-dev libglm-dev libgl1-mesa-glx libegl1-mesa-dev mesa-utils xorg-dev freeglut3-dev
  1. Installing habitat-sim
    Instructed by ActiveNeuralSLAM
cd ~/Desktop
git clone https://github.com/facebookresearch/habitat-sim.git
cd habitat-sim; git checkout 9575dcd45fe6f55d2a44043833af08972a7895a9; 

The checkout information is as below:

(habitat) root@c:~/Desktop# cd habitat-sim; git checkout 9575dcd45fe6f55d2a44043833af08972a7895a9;
Note: checking out '9575dcd45fe6f55d2a44043833af08972a7895a9'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

git checkout -b

HEAD is now at 9575dcd Bullet Physics Integration #1 (#91)

pip install -r requirements.txt; 

I get a warning:

(habitat) root@c:~/Desktop/habitat-sim# pip install -r requirements.txt;
WARNING: The directory '/home/u/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.

python setup.py install --headless

I get the same warning:

Using /home/u/anaconda3/envs/habitat/lib/python3.6/site-packages
Finished processing dependencies for habitat-sim==0.1.2
WARNING: The directory '/home/u/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Processing ./build/deps/magnum-bindings/src/python
Building wheels for collected packages: magnum
Building wheel for magnum (setup.py) ... done
Created wheel for magnum: filename=magnum-0.0.0-cp36-cp36m-linux_x86_64.whl size=1310443 sha256=d5590e83d54bc3a439f78670780bc949dc9fde561942b2aec0de69a5bc732bb7
Stored in directory: /tmp/pip-ephem-wheel-cache-q697ojl2/wheels/31/f6/f6/24e2dea66d597afa365ec31feb5ef879b12b7e448712ffaa0d
Successfully built magnum
Installing collected packages: magnum
Successfully installed magnum-0.0.0

  1. Installing habitat-api:
    Instructed by ActiveNeuralSLAM
cd ~/Desktop
git clone https://github.com/facebookresearch/habitat-api.git
cd habitat-api; git checkout b5f2b00a25627ecb52b43b13ea96b05998d9a121; 

The checkout information is as below:

(habitat) root@c:~/Desktop# cd habitat-api; git checkout b5f2b00a25627ecb52b43b13ea96b05998d9a121;
Note: checking out 'b5f2b00a25627ecb52b43b13ea96b05998d9a121'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

git checkout -b

Overview

HEAD is now at b5f2b00 Correct the naming of PointGoalNav Sensors (#180)

pip install -e .

  1. Installing pytorch
conda install pytorch==1.2.0 torchvision cudatoolkit=11.0 -c pytorch

I install the 11.0 version instead of 10.0 because my cuda is 11.0. I don't know whether it will have bad effect.

Also, the result of following commands is False, does it matter?

python
import torch
torch.cuda.is_available()
  1. Setup
cd ~/Desktop
git clone --recurse-submodules https://github.com/devendrachaplot/Neural-SLAM

Running git clone command I get the information below. As you see there is a checkout information 8ac1b16aa0554b10748a925f8a937954c77c1563. However I cannot git checkout it neither in ~/Desktop or in ~/Desktop/Neural-SLAM. and get fatal: reference is not a tree: 8ac1b16aa0554b10748a925f8a937954c77c1563
Does it matter?

(habitat) root@c:~/Desktop# git clone --recurse-submodules https://github.com/devendrachaplot/Neural-SLAM
Cloning into 'Neural-SLAM'...
remote: Enumerating objects: 50, done.
remote: Total 50 (delta 0), reused 0 (delta 0), pack-reused 50
Unpacking objects: 100% (50/50), done.
Submodule 'env/habitat/habitat_api' (https://github.com/devendrachaplot/habitat-api) registered for path 'env/habitat/habitat_api'
Cloning into '/home/u/Desktop/Neural-SLAM/env/habitat/habitat_api'...
remote: Enumerating objects: 2824, done.
remote: Total 2824 (delta 0), reused 0 (delta 0), pack-reused 2824
Receiving objects: 100% (2824/2824), 27.98 MiB | 5.77 MiB/s, done.
Resolving deltas: 100% (1811/1811), done.
Submodule path 'env/habitat/habitat_api': checked out '8ac1b16aa0554b10748a925f8a937954c77c1563'

cd Neural-SLAM;
pip install -r requirements.txt

Up to this step, I only get warnings without error.

Error

At first, I try to remove the lock of my folders.

sudo chmod 777 -R ~/Desktop/habitat-sim
sudo chmod 777 -R ~/Desktop/habitat-api
sudo chmod 777 -R ~/Desktop/Neural-SLAM

Then I try to run python main.py -n1 --auto_gpu_config 0 --split val. I will get error. Let me introduce in three situation:
Situation-1: If I write ~/.bashrc with unset PYTHONPATH:

(habitat) root@c:~/Desktop/Neural-SLAM# python main.py -n1 --auto_gpu_config 0 --split val
Traceback (most recent call last):
File "main.py", line 15, in
from env import make_vec_envs# Overview
File "/home/u/Desktop/Neural-SLAM/env/init.py", line 3, in
from .habitat import construct_envs
File "/home/u/Desktop/Neural-SLAM/env/habitat/init.py", line 9, in
from .exploration_env import Exploration_Env
File "/home/u/Desktop/Neural-SLAM/env/habitat/exploration_env.py", line 29, in
import env.habitat.utils.pose as pu
AttributeError: module 'env' has no attribute 'habitat'

Situation-2: If I write ~/.bashrc with export PYTHONPATH=$PYTHONPATH:~/Desktop/habitat-sim/:

(habitat) root@c:~/Desktop/Neural-SLAM# python main.py -n1 --auto_gpu_config 0 --split val
Traceback (most recent call last):
File "main.py", line 15, in
from env import make_vec_envs
File "/home/u/Desktop/Neural-SLAM/env/init.py", line 3, in
from .habitat import construct_envs
File "/home/u/Desktop/Neural-SLAM/env/habitat/init.py", line 9, in
from .exploration_env import Exploration_Env
File "/home/u/Desktop/Neural-SLAM/env/habitat/exploration_env.py", line 28, in
from env.habitat.utils.noisy_actions import CustomActionSpaceConfiguration
File "/home/u/Desktop/Neural-SLAM/env/habitat/utils/noisy_actions.py", line 5, in
import habitat_sim
File "/home/u/Desktop/habitat-sim/habitat_sim/init.py", line 12, in
from .nav import *
File "/home/u/Desktop/habitat-sim/habitat_sim/nav/init.py", line 1, in
from .greedy_geodesic_follower import GreedyGeodesicFollower
File "/home/u/Desktop/habitat-sim/habitat_sim/nav/greedy_geodesic_follower.py", line 6, in
import habitat_sim.agent
File "/home/u/Desktop/habitat-sim/habitat_sim/agent/init.py", line 7, in
from .agent import *
File "/home/u/Desktop/habitat-sim/habitat_sim/agent/agent.py", line 14, in
import habitat_sim.bindings as hsim
File "/home/u/Desktop/habitat-sim/habitat_sim/bindings/init.py", line 24, in
from habitat_sim._ext.habitat_sim_bindings import Simulator as SimulatorBackend
ModuleNotFoundError: No module named 'habitat_sim._ext'

Situation-3: If I write ~/.bashrc without any extra code:

(habitat) root@c:~/Desktop/Neural-SLAM# python main.py -n1 --auto_gpu_config 0 --split val
Traceback (most recent call last):
File "main.py", line 15, in
from env import make_vec_envs
File "/home/u/Desktop/Neural-SLAM/env/init.py", line 3, in
from .habitat import construct_envs
File "/home/u/Desktop/Neural-SLAM/env/habitat/init.py", line 9, in
from .exploration_env import Exploration_Env
File "/home/u/Desktop/Neural-SLAM/env/habitat/exploration_env.py", line 29, in
import env.habitat.utils.pose as pu
AttributeError: module 'env' has no attribute 'habitat'

So, what should I write in ~/.bashrc? And how to fix the problem?

Thank you very much for reading!

Expectation

Successfully run the codes.

from neural-slam.

Sunnyzhr avatar Sunnyzhr commented on July 21, 2024

@devendrachaplot Thank you so much for reply!

I follow your instructions carefully, and encounter another errorAttributeError: module 'env' has no attribute 'habitat'. Fortunately, I follow your instruction again to solve the problem. (By change import ... to from ... import ... ) THANKS again!!!

After that, I encounter another trouble that I cannot run with GPU. I fix it by change my torch(cuda11.0) to torch(cuda10.0).

Then, I start to run commands of the tutorial, I've encounter several new problems as below:

New problem 1 - python main.py -n1 --auto_gpu_config 0 --split val

The command runs without error at the first 38 minuets. However, then it encounter errors as below. Additionally, I find that there are some other people who encouter the same error. The code will fail at Cantwell.glb

...
...
Time: 00d 00h 37m 49s, num timesteps 980, FPS 0,
Rewards:
Losses: Local Loss: 4.630, SLAM Loss proj/exp/pose:0.0004/0.0004/0.0101
Time: 00d 00h 38m 11s, num timesteps 990, FPS 0,
Rewards:
Losses: Local Loss: 4.661, SLAM Loss proj/exp/pose:0.0003/0.0003/0.0100
2020-10-27 17:39:42,208 Computing map for data/scene_datasets/gibson/Cantwell.glb
Traceback (most recent call last):
File "main.py", line 769, in
main()
File "main.py", line 617, in main
g_agent.update(g_rollouts)
File "/home/u/Desktop/Neural-SLAM/algo/ppo.py", line 58, in update
for sample in data_generator:
File "/home/u/Desktop/Neural-SLAM/utils/storage.py", line 95, in feed_forward_generator
mini_batch_size = batch_size // num_mini_batch
ZeroDivisionError: integer division or modulo by zero
Exception ignored in: <bound method VectorEnv.del of <env.habitat.habitat_api.habitat.core.vector_env.VectorEnv object at 0x7faf77d21c18>>
Traceback (most recent call last):
File "/home/u/Desktop/Neural-SLAM/env/habitat/habitat_api/habitat/core/vector_env.py", line 487, in del
self.close()
File "/home/u/Desktop/Neural-SLAM/env/habitat/habitat_api/habitat/core/vector_env.py", line 351, in close
write_fn((CLOSE_COMMAND, None))
File "/home/u/anaconda3/envs/habitat/lib/python3.6/multiprocessing/connection.py", line 206, in send
self._send_bytes(_ForkingPickler.dumps(obj))
File "/home/u/anaconda3/envs/habitat/lib/python3.6/multiprocessing/connection.py", line 404, in _send_bytes
self._send(header + buf)
File "/home/u/anaconda3/envs/habitat/lib/python3.6/multiprocessing/connection.py", line 368, in _send
n = write(self._handle, buf)
BrokenPipeError: [Errno 32] Broken pipe

New problem 2 - python main.py

The error information is:

(habitat) root@c:~/Desktop/Neural-SLAM# python main.py
Traceback (most recent call last):
File "main.py", line 33, in
args = get_args()
File "/home/u/Desktop/Neural-SLAM/arguments.py", line 198, in get_args
/1024/1024/1024 > 10.0, "Insufficient GPU memory"
AssertionError: Insufficient GPU memory

I check my GPU memory (I only have 1 GPU) with torch.cuda.get_device_properties(0).total_memory/1024/1024/1024 . The result is 3.81195068359375 which is less than 10.
I see the arguments.py, there are two lines:

num_processes_per_gpu = int(gpu_memory/1.4)
num_processes_on_first_gpu = int((gpu_memory - 10.0)/1.4)

Therefore, could you please recommend me a value of num_processes_per_gpu and num_processes_on_first_gpu?

Expectation

Successfully run the codes.

Thanks for your attention!

from neural-slam.

devendrachaplot avatar devendrachaplot commented on July 21, 2024

For the first problem, you can try adding the argument: --num_mini_batch 1

For the second problem, you can try running the habitat simulator and/or model without using the GPU. For running habitat without GPU, you need to install the CPU version. For running the model without using the GPU, you can use --no_cuda argument.

from neural-slam.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.