Mmcv-full Install

0 views
Skip to first unread message

Gaetan Boren

unread,
Aug 5, 2024, 7:57:07 AM8/5/24
to discwigoldclic
Donot install both versions in the same environment, otherwise you may encounter errors like ModuleNotFound. You need to uninstall one before installing the other. Installing the full version is highly recommended if CUDA is avaliable.

If you find that the above installation command does not use a pre-built package ending with .whl but a source package ending with .tar.gz, you may not have a pre-build package corresponding to the PyTorch or CUDA or mmcv version, in which case you can build mmcv from source.


If you would like to use opencv-python-headless instead of opencv-python,e.g., in a minimum container environment or servers without GUI,you can first install it before installing MMCV to skip the installation of opencv-python.


If you do not find a corresponding version in the dropdown box above, you probably do not have a pre-built package corresponding to the PyTorch or CUDA or mmcv version, at which point you can build mmcv from source.


mmcv is only compiled on PyTorch 1.x.0 because the compatibilityusually holds between 1.x.0 and 1.x.1. If your PyTorch version is 1.x.1, youcan install mmcv compiled with PyTorch 1.x.0 and it usually works well.For example, if your PyTorch version is 1.8.1, you can feel free to choose 1.8.x.


c. Some dependencies are optional. Simply running pip install -v -e . willonly install the minimum runtime requirements. To use optional dependencies like albumentations and imagecorruptions either install them manually with pip install -r requirements/optional.txt or specify desired extras when calling pip (e.g. pip install -v -e .[optional]). Valid keys for the extras field are: all, tests, build, and optional.


d. If you would like to use albumentations, we suggest usingpip install albumentations>=0.3.2 --no-binary imgaug,albumentations. If you simply usepip install albumentations>=0.3.2, it will install opencv-python-headless simultaneously (even though you have already installed opencv-python). We should not allow opencv-python and opencv-python-headless installed at the same time, because it might cause unexpected issues. Please refer to official documentation for more details.


The required versions of MMCV, MMDetection and MMSegmentation for different versions of MMDetection3D are as below. Please install the correct version of MMCV, MMDetection and MMSegmentation to avoid installation issues.


The git commit id will be written to the version number with step d, e.g. 0.6.0+2e7045c. The version will also be saved in trained models.It is recommended that you run step d each time you pull some updates from github. If C++/CUDA codes are modified, then this step is compulsory.


Following the above instructions, mmdetection is installed on dev mode, any local modifications made to the code will take effect without the need to reinstall it (unless you submit some commits and want to update the version number).


Some dependencies are optional. Simply running pip install -v -e . will only install the minimum runtime requirements. To use optional dependencies like albumentations and imagecorruptions either install them manually with pip install -r requirements/optional.txt or specify desired extras when calling pip (e.g. pip install -v -e .[optional]). Valid keys for the extras field are: all, tests, build, and optional.


If you want to input a ply file, you can use the following function and convert it to bin format. Then you can use the converted bin file to generate demo.Note that you need to install pandas and plyfile before using this script. This function can also be used for data preprocessing for training ply data.


mmcv-full is only compiled on PyTorch 1.x.0 because the compatibility usually holds between 1.x.0 and 1.x.1. If your PyTorch version is 1.x.1, you can install mmcv-full compiled with PyTorch 1.x.0 and it usually works well.


I searched the error on google and they advise to install mmcv-full instead of mmcv but when I install the last version (1.7.1) of mmcv-full I have an error message telling me that I must have mmcv version 2.0


From the site I know that there is no mmcv-full package in my environment. However, when I turn to Docs of mmcv-full, there is no corresponding version to torch2.0.0+cuda118, the environment in my computer.


You are reading the documentation for MMClassification 0.x, which will soon be deprecated at the end of 2022. We recommend you upgrade to MMClassification 1.0 to enjoy fruitful new features and better performance brought by OpenMMLab 2.0. Check the installation tutorial, migration tutorial and changelog for more details.


Install from source (Recommended): You want to develop your own image classification task or new features based on MMClassification framework. For example, you want to add new dataset or new models. And you can use all tools we provided.


You will see the output result dict including pred_label, pred_score and pred_class in your terminal.And if you have graphical interface (instead of remote terminal etc.), you can enable --show option to showthe demo image with these predictions in a window.


If it compiles during installation, then please check that the CUDA version and PyTorch version exactly matches the version in the mmcv-full installation command. For example, PyTorch 1.7.0 and 1.7.1 are treated differently.


It is recommended to symlink the dataset root to mmocr/data. Please refer to datasets.md to prepare your datasets.If your folder structure is different, you may need to change the corresponding paths in config files.


For Windows users, ImageMagick will not be automatically detected by MoviePy,there is a need to modify moviepy/config_defaults.py file by providing the path to the ImageMagick binary called magick, like IMAGEMAGICK_BINARY = "C:\\Program Files\\ImageMagick_VERSION\\magick.exe"


Some dependencies are optional. Running python setup.py develop will only install the minimum runtime requirements.To use optional dependencies like decord, either install them with pip install -r requirements/optional.txtor specify desired extras when calling pip (e.g. pip install -v -e .[optional],valid keys for the [optional] field are all, tests, build, and optional) like pip install -v -e .[tests,build].


The git commit id will be written to the version number with step b, e.g. 0.6.0+2e7045c. The version will also be saved in trained models.It is recommended that you run step b each time you pull some updates from github. If C++/CUDA codes are modified, then this step is compulsory.


b. If you would like to use albumentations, we suggest using pip install -r requirements/albu.txt or pip install -U albumentations --no-binary qudida,albumentations. If you simply use pip install albumentations==1.0.1, it will install opencv-python-headless simultaneously (even though you have already installed opencv-python). We recommended checking the environment after installing albumentation to ensure that opencv-python and opencv-python-headless are not installed at the same time, because it might cause unexpected issues if they both installed. Please refer to official documentation for more details.


Users may also refer to PyTorch3D-install for more details.However, our recent tests show that installing using conda sometimes runs into dependency conflicts.Hence, users may alternatively install Pytorch3D from source following the steps below.


-e means editable mode.When import mmagic, modules under the cloned directory are imported.If pip install without -e, pip will copy cloned codes to somewhere like lib/python/site-package.Consequently, modified code under the cloned directory takes no effect unless pip install again.Thus, pip install with -e is particularly convenient for developers. If some codes are modified, new codes will be imported next time without reinstallation.

3a8082e126
Reply all
Reply to author
Forward
0 new messages