Skip to content

Latest commit

 

History

History
145 lines (115 loc) · 4.35 KB

CONDA.md

File metadata and controls

145 lines (115 loc) · 4.35 KB

Install under Anaconda or Miniconda

I've successfully tested pyslam with Anaconda (version 2019.10, build py37_0) and Miniconda (SHA256 hash 957d2f0f0701c3d1335e3b39f235d197837ad69a944fa6f5d8ad2c686b69df3b) under Linux.
Please, follow the instructions below. I assume you already installed Anaconda or Miniconda, and correctly set your conda python environment.

Basic Conda Installation

In order to run main_vo.py with conda, get in the root of this repository and run the following command:

$ . pyenv-conda-create.sh 

N.B.: do not forget the dot! (without '/' !)

This will create a custom pyslam conda environment and will also activate the created pyslam environment. Now, from the same terminal, you can run:

$ python3 -O main_vo.py

If you want to use a new terminal, you need to activate the pyslam environment as explained in this section.

Full Conda Installation

In order to run main_slam.py with conda, get in the root of this repository and run the following command:

$ . install_all_conda.sh  

N.B.: do not forget the dot! (without '/' !)

This will compile the required thirdparty packages and will also activate the created pyslam environment. Now, from the same terminal, you can run:

$ python3 -O main_slam.py

If you want to use a new terminal, you need to activate the pyslam environment as explained in this section.

Create a pyslam conda environment

You already see this above. In order to create a custom pyslam conda environment, get in the root of this repository and run the following command:

$ . pyenv-conda-create.sh 

Activate the created pyslam conda environment

Run the following command (N.B., do not forget the dot!):

$ . pyenv-conda-activate.sh 

or

$ conda activate pyslam 

Now, you can launch pySLAM scripts.

Deactivate pyslam conda environment

To deactivate the pyslam environment, run

$ conda deactivate

Delete pyslam conda environment

To delete the pyslam environment, run

$ . pyenv-conda-delete.sh 

General Notes About Conda

Below, you can find some useful details. The scripts mentioned above make the work for you.

Install packages/env from file

You can generate a requirements.txt file by running:

$ conda list -e > requirements-conda.txt

You can create and environment from such a file by runnning:

$ conda create --name <env> --file requirements-conda.txt

N.B.: the file requirements.txt generated by conda cannot be used with pip3 (and viceversa)!

Another approach is to use .yml files. In order to create a file requirements-conda.yml run:

$ conda env export > requirements-conda.yml

or

$ conda env export --no-builds > requirements-conda-nobuilds.yml

for generating a requirements file without build numbers.
You can create an environment from it by running:

$ conda env create -f requirements.yml

Deleting an environment

To delete an environment, in your terminal window or an Anaconda Prompt, run:

$ conda remove --name myenv --all

this command will also return you some conda infos.

You may instead use the simpler command:

$ conda env remove --name myenv

To verify that the environment was removed, in your terminal window or an Anaconda Prompt, run:

$ conda info --envs

The environments list that displays should not show the removed environment.

In order to create a new conda environment opencvenv, activate it and install OpenCV in it, run the following commands:

$ conda create -yn opencvenv python=3.6.9
$ conda activate opencvenv
$ conda install -c menpo opencv3

This should install OpenCV 3.4.1 and everything you need to run SIFT and SURF.

In order to install pytorch and torchvision:

$ conda install pytorch torchvision cudatoolkit=10.1 -c pytorch

or (if you do not have an NVIDIA GPU)

$ conda install -c pytorch torchvision

To deactivate the opencvenv environment, use

$ conda deactivate

This command will bring you back to your default conda environment.

To re-activate the conda opencvenv environment, use

$ conda activate opencvenv