Skip to content

Commit

Permalink
[Fix]: Modify the min version of python to 3.7 in CI & update docs (#…
Browse files Browse the repository at this point in the history
…1877)

* modify ci config

* minor changes

* min python==3.7.4 & update install docs

* fix data_preprocessor

* fix data_preprocessor

* install waymo-open-dataset-tf-2-6-0

* update docs
  • Loading branch information
JingweiZhang12 authored Sep 29, 2022
1 parent be937d4 commit ea131eb
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 19 deletions.
16 changes: 5 additions & 11 deletions .circleci/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ jobs:
type: string
torchvision:
type: string
mmcv:
type: string
docker:
- image: cimg/python:<< parameters.python >>
resource_class: large
Expand All @@ -62,7 +60,8 @@ jobs:
name: Install mmdet3d dependencies
command: |
python -m pip install git+ssh://git@github.com/open-mmlab/mmengine.git@main
python -m pip install << parameters.mmcv >>
python -m pip install -U openmim
python -m mim install 'mmcv >= 2.0.0rc1'
python -m pip install git+ssh://git@github.com/open-mmlab/mmdetection.git@dev-3.x
python -m pip install -r requirements.txt
- run:
Expand All @@ -85,8 +84,6 @@ jobs:
cudnn:
type: integer
default: 7
mmcv:
type: string
machine:
image: ubuntu-2004-cuda-11.4:202110-01
# docker_layer_caching: true
Expand All @@ -108,7 +105,8 @@ jobs:
name: Install mmdet3d dependencies
command: |
docker exec mmdet3d pip install -e /mmengine
docker exec mmdet3d pip install << parameters.mmcv >>
docker exec pip install -U openmim
docker exec mim install 'mmcv >= 2.0.0rc1'
docker exec mmdet3d pip install -e /mmdetection
docker exec mmdet3d pip install -r requirements.txt
- run:
Expand Down Expand Up @@ -144,16 +142,14 @@ workflows:
name: minimum_version_cpu
torch: 1.6.0
torchvision: 0.7.0
python: 3.6.9 # The lowest python 3.6.x version available on CircleCI images
mmcv: https://download.openmmlab.com/mmcv/dev-2.x/cpu/torch1.6.0/mmcv_full-2.0.0rc0-cp36-cp36m-manylinux1_x86_64.whl
python: 3.7.4
requires:
- lint
- build_cpu:
name: maximum_version_cpu
torch: 1.9.0
torchvision: 0.10.0
python: 3.9.0
mmcv: https://download.openmmlab.com/mmcv/dev-2.x/cpu/torch1.9.0/mmcv_full-2.0.0rc0-cp39-cp39-manylinux1_x86_64.whl
requires:
- minimum_version_cpu
- hold:
Expand All @@ -166,7 +162,6 @@ workflows:
# Use double quotation mark to explicitly specify its type
# as string instead of number
cuda: "10.2"
mmcv: https://download.openmmlab.com/mmcv/dev-2.x/cu102/torch1.8.0/mmcv_full-2.0.0rc0-cp37-cp37m-manylinux1_x86_64.whl
requires:
- hold
merge_stage_test:
Expand All @@ -179,7 +174,6 @@ workflows:
torch: 1.6.0
# Use double quotation mark to explicitly specify its type
# as string instead of number
mmcv: https://download.openmmlab.com/mmcv/dev-2.x/cu101/torch1.6.0/mmcv_full-2.0.0rc0-cp37-cp37m-manylinux1_x86_64.whl
cuda: "10.1"
filters:
branches:
Expand Down
4 changes: 4 additions & 0 deletions docs/en/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ If you are experienced with PyTorch and have already installed it, just skip thi
**Step 1.** Create a conda environment and activate it.

```shell
# We recommend to install python=3.8 since the waymo-open-dataset-tf-2-6-0 requires python>=3.7
# If you want to install python<3.7, make sure to install waymo-open-dataset-tf-2-x-0 (x<=4)
conda create --name openmmlab python=3.8 -y
conda activate openmmlab
```
Expand Down Expand Up @@ -254,6 +256,8 @@ docker run --gpus all --shm-size=8g -it -v {DATA_DIR}:/mmdetection3d/data mmdete
Here is a full script for setting up MMdetection3D with conda.
```shell
# We recommend to install python=3.8 since the waymo-open-dataset-tf-2-6-0 requires python>=3.7
# If you want to install python<3.7, make sure to install waymo-open-dataset-tf-2-x-0 (x<=4)
conda create -n open-mmlab python=3.8 -y
conda activate open-mmlab

Expand Down
6 changes: 5 additions & 1 deletion docs/zh_cn/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ MMDetection3D 可以安装在 Linux, MacOS, (实验性支持 Windows) 的平台
**步骤 1.** 使用 conda 新建虚拟环境,并进入该虚拟环境.

```shell
# 鉴于 waymo-open-dataset-tf-2-6-0 要求 python>=3.7, 我们推荐安装 python3.8
# 如果您想要安装 python3.6, 之后须确保安装 waymo-open-dataset-tf-2-x-0 (x<=4)
conda create --name openmmlab python=3.8 -y
conda activate openmmlab
```
Expand Down Expand Up @@ -269,7 +271,9 @@ docker run --gpus all --shm-size=8g -it -v {DATA_DIR}:/mmdetection3d/data mmdete
以下是一个基于 conda 安装 MMdetection3D 的脚本
```shell
conda create -n open-mmlab python=3.7 -y
# 鉴于 waymo-open-dataset-tf-2-6-0 要求 python>=3.7, 我们推荐安装 python3.8
# 如果您想要安装 python3.6, 之后须确保安装 waymo-open-dataset-tf-2-x-0 (x<=4)
conda create -n open-mmlab python=3.8 -y
conda activate open-mmlab
# install latest PyTorch prebuilt with the default prebuilt CUDA version (usually the latest)
Expand Down
10 changes: 5 additions & 5 deletions mmdet3d/models/data_preprocessors/data_preprocessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from mmdet3d.registry import MODELS
from mmdet3d.utils import OptConfigType
from mmdet.models import DetDataPreprocessor
from mmdet.models.utils.misc import samplelist_boxlist2tensor
from mmdet.models.utils.misc import samplelist_boxtype2tensor


@MODELS.register_module()
Expand Down Expand Up @@ -75,7 +75,7 @@ def __init__(self,
seg_pad_value: int = 255,
bgr_to_rgb: bool = False,
rgb_to_bgr: bool = False,
boxlist2tensor: bool = True,
boxtype2tensor: bool = True,
batch_augments: Optional[List[dict]] = None):
super().__init__(
mean=mean,
Expand All @@ -88,7 +88,7 @@ def __init__(self,
seg_pad_value=seg_pad_value,
bgr_to_rgb=bgr_to_rgb,
rgb_to_bgr=rgb_to_bgr,
boxlist2tensor=boxlist2tensor,
boxtype2tensor=boxtype2tensor,
batch_augments=batch_augments)
self.voxel = voxel
self.voxel_type = voxel_type
Expand Down Expand Up @@ -169,8 +169,8 @@ def simple_process(self, data: dict, training: bool = False) -> dict:
'pad_shape': pad_shape
})

if self.boxlist2tensor:
samplelist_boxlist2tensor(data_samples)
if self.boxtype2tensor:
samplelist_boxtype2tensor(data_samples)

if self.pad_mask:
self.pad_gt_masks(data_samples)
Expand Down
4 changes: 2 additions & 2 deletions requirements/optional.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
black==20.8b1 # be compatible with typing-extensions 3.7.4
spconv
typing-extensions==3.7.4 # required by tensorflow before version 2.6
waymo-open-dataset-tf-2-4-0
typing-extensions==3.7.4 # required by tensorflow<=2.6
waymo-open-dataset-tf-2-6-0 # requires python>=3.7

0 comments on commit ea131eb

Please sign in to comment.