Skip to main content

Use Conda Perform dependency management

info

The use introduced here Conda Dependency management is the complete creation of an independent environment. Usually means you need one that comes with the system Python Different versions of the environment. If there were no such requirement, there would be no need to create an independent environment.adopt pip install --user The way is completely achievable. You can refer to the document [By default-python-Install additional dependencies under version](/docs/runtimes#2-By default-python-Install additional dependencies under version).

HyperAI In the middle Python It's through Conda Managing. The default installation environment path can be obtained through the following command:

$ conda env list

# Conda environments:
#
base * /usr/local

You can see that the default environment is /usr/local in. The dependencies in each environment can be achieved through conda list obtain. On the left side of the document "Runtime environment" The complete installation dependency list is also provided below.

Use Conda Create a new environment

1. Stay /hyperai/home Create a new environment below

conda create -p open-mmlab python=3.9 -y

After installation, pass through conda activate /hyperai/home/open-mmlab Activate a new environment.

note

The key to being able to save the environment is to store the new environment's save path in /hyperai/home lower, adopt "Continue to execute" You can bind this part of the content to a new execution again.

2. According to file Install other dependencies

conda install pytorch torchvision -c pytorch

git clone https://github.com/open-mmlab/mmdetection.git
cd mmdetection

# Continue installation according to official documentation
pip install mmcv
pip install -r requirements/build.txt
pip install "git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI"
pip install -v -e . # or "python setup.py develop"

After installation is completed, mmdetection The relevant dependencies have been installed /hyperai/home/open-mmlab (that is /output/open-mmlab lower.

3. Open the original execution by continuing to execute

adopt "Continue to execute" The way we prepared last time mmdetection Bind the environment to run in a new execution. By command conda activate /hyperai/home/open-mmlab/ You can reactivate the previously configured environment to continue using it.

Newly created Conda With Jupyter Workplace integration

Jupyter The workspace can be connected with Conda Integrate to allow the same notebook Specify different Conda environment. Follow these steps to customize a Conda Add environment to Jupyter In the workspace.

conda activate /hyperai/home/open-mmlab/
(/hyperai/home/open-mmlab/)$ conda install ipykernel
(/hyperai/home/open-mmlab/)$ ipython kernel install --name=open-mmlab

Reopen Jupyter After the workspace page You can see that there is an additional option available: