Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
MMCV
Commits
c3835415
Unverified
Commit
c3835415
authored
Aug 24, 2022
by
Zaida Zhou
Committed by
GitHub
Aug 24, 2022
Browse files
[Refactor] Modify the importing path due to mmengine changes (#2224)
parent
5fdd246a
Changes
23
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
27 additions
and
24 deletions
+27
-24
mmcv/cnn/bricks/activation.py
mmcv/cnn/bricks/activation.py
+2
-1
mmcv/cnn/bricks/context_block.py
mmcv/cnn/bricks/context_block.py
+1
-1
mmcv/cnn/bricks/conv_module.py
mmcv/cnn/bricks/conv_module.py
+2
-2
mmcv/cnn/bricks/generalized_attention.py
mmcv/cnn/bricks/generalized_attention.py
+1
-1
mmcv/cnn/bricks/hswish.py
mmcv/cnn/bricks/hswish.py
+2
-1
mmcv/cnn/bricks/non_local.py
mmcv/cnn/bricks/non_local.py
+1
-1
mmcv/cnn/bricks/norm.py
mmcv/cnn/bricks/norm.py
+2
-2
mmcv/cnn/bricks/transformer.py
mmcv/cnn/bricks/transformer.py
+1
-1
mmcv/cnn/bricks/upsample.py
mmcv/cnn/bricks/upsample.py
+1
-1
mmcv/cnn/resnet.py
mmcv/cnn/resnet.py
+1
-1
mmcv/cnn/vgg.py
mmcv/cnn/vgg.py
+1
-1
mmcv/ops/carafe.py
mmcv/ops/carafe.py
+1
-1
mmcv/ops/deform_conv.py
mmcv/ops/deform_conv.py
+1
-1
mmcv/ops/modulated_deform_conv.py
mmcv/ops/modulated_deform_conv.py
+1
-1
mmcv/ops/multi_scale_deform_attn.py
mmcv/ops/multi_scale_deform_attn.py
+1
-2
mmcv/ops/saconv.py
mmcv/ops/saconv.py
+3
-2
mmcv/utils/env.py
mmcv/utils/env.py
+1
-1
mmcv/utils/parrots_jit.py
mmcv/utils/parrots_jit.py
+1
-1
tests/test_cnn/test_build_layers.py
tests/test_cnn/test_build_layers.py
+1
-1
tests/test_cnn/test_conv_module.py
tests/test_cnn/test_conv_module.py
+2
-1
No files found.
mmcv/cnn/bricks/activation.py
View file @
c3835415
...
@@ -5,7 +5,8 @@ import torch
...
@@ -5,7 +5,8 @@ import torch
import
torch.nn
as
nn
import
torch.nn
as
nn
import
torch.nn.functional
as
F
import
torch.nn.functional
as
F
from
mmengine.registry
import
MODELS
from
mmengine.registry
import
MODELS
from
mmengine.utils
import
TORCH_VERSION
,
digit_version
from
mmengine.utils
import
digit_version
from
mmengine.utils.dl_utils
import
TORCH_VERSION
for
module
in
[
for
module
in
[
nn
.
ReLU
,
nn
.
LeakyReLU
,
nn
.
PReLU
,
nn
.
RReLU
,
nn
.
ReLU6
,
nn
.
ELU
,
nn
.
ReLU
,
nn
.
LeakyReLU
,
nn
.
PReLU
,
nn
.
RReLU
,
nn
.
ReLU6
,
nn
.
ELU
,
...
...
mmcv/cnn/bricks/context_block.py
View file @
c3835415
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
from
typing
import
Union
from
typing
import
Union
import
torch
import
torch
from
mmengine.model
.utils
import
constant_init
,
kaiming_init
from
mmengine.model
import
constant_init
,
kaiming_init
from
mmengine.registry
import
MODELS
from
mmengine.registry
import
MODELS
from
torch
import
nn
from
torch
import
nn
...
...
mmcv/cnn/bricks/conv_module.py
View file @
c3835415
...
@@ -4,9 +4,9 @@ from typing import Dict, Optional, Tuple, Union
...
@@ -4,9 +4,9 @@ from typing import Dict, Optional, Tuple, Union
import
torch
import
torch
import
torch.nn
as
nn
import
torch.nn
as
nn
from
mmengine.model
.utils
import
constant_init
,
kaiming_init
from
mmengine.model
import
constant_init
,
kaiming_init
from
mmengine.registry
import
MODELS
from
mmengine.registry
import
MODELS
from
mmengine.utils.parrots_wrapper
import
_BatchNorm
,
_InstanceNorm
from
mmengine.utils.
dl_utils.
parrots_wrapper
import
_BatchNorm
,
_InstanceNorm
from
.activation
import
build_activation_layer
from
.activation
import
build_activation_layer
from
.conv
import
build_conv_layer
from
.conv
import
build_conv_layer
...
...
mmcv/cnn/bricks/generalized_attention.py
View file @
c3835415
...
@@ -5,7 +5,7 @@ import numpy as np
...
@@ -5,7 +5,7 @@ import numpy as np
import
torch
import
torch
import
torch.nn
as
nn
import
torch.nn
as
nn
import
torch.nn.functional
as
F
import
torch.nn.functional
as
F
from
mmengine.model
.utils
import
kaiming_init
from
mmengine.model
import
kaiming_init
from
mmengine.registry
import
MODELS
from
mmengine.registry
import
MODELS
...
...
mmcv/cnn/bricks/hswish.py
View file @
c3835415
...
@@ -2,7 +2,8 @@
...
@@ -2,7 +2,8 @@
import
torch
import
torch
import
torch.nn
as
nn
import
torch.nn
as
nn
from
mmengine.registry
import
MODELS
from
mmengine.registry
import
MODELS
from
mmengine.utils
import
TORCH_VERSION
,
digit_version
from
mmengine.utils
import
digit_version
from
mmengine.utils.dl_utils
import
TORCH_VERSION
class
HSwish
(
nn
.
Module
):
class
HSwish
(
nn
.
Module
):
...
...
mmcv/cnn/bricks/non_local.py
View file @
c3835415
...
@@ -4,7 +4,7 @@ from typing import Dict, Optional
...
@@ -4,7 +4,7 @@ from typing import Dict, Optional
import
torch
import
torch
import
torch.nn
as
nn
import
torch.nn
as
nn
from
mmengine.model
.utils
import
constant_init
,
normal_init
from
mmengine.model
import
constant_init
,
normal_init
from
mmengine.registry
import
MODELS
from
mmengine.registry
import
MODELS
from
.conv_module
import
ConvModule
from
.conv_module
import
ConvModule
...
...
mmcv/cnn/bricks/norm.py
View file @
c3835415
...
@@ -5,8 +5,8 @@ from typing import Dict, Tuple, Union
...
@@ -5,8 +5,8 @@ from typing import Dict, Tuple, Union
import
torch.nn
as
nn
import
torch.nn
as
nn
from
mmengine.registry
import
MODELS
from
mmengine.registry
import
MODELS
from
mmengine.utils
import
is_tuple_of
from
mmengine.utils
import
is_tuple_of
from
mmengine.utils.parrots_wrapper
import
(
SyncBatchNorm
,
_BatchNorm
,
from
mmengine.utils.
dl_utils.
parrots_wrapper
import
(
SyncBatchNorm
,
_BatchNorm
,
_InstanceNorm
)
_InstanceNorm
)
MODELS
.
register_module
(
'BN'
,
module
=
nn
.
BatchNorm2d
)
MODELS
.
register_module
(
'BN'
,
module
=
nn
.
BatchNorm2d
)
MODELS
.
register_module
(
'BN1d'
,
module
=
nn
.
BatchNorm1d
)
MODELS
.
register_module
(
'BN1d'
,
module
=
nn
.
BatchNorm1d
)
...
...
mmcv/cnn/bricks/transformer.py
View file @
c3835415
...
@@ -7,7 +7,7 @@ from typing import Sequence
...
@@ -7,7 +7,7 @@ from typing import Sequence
import
torch
import
torch
import
torch.nn
as
nn
import
torch.nn
as
nn
import
torch.nn.functional
as
F
import
torch.nn.functional
as
F
from
mmengine
import
ConfigDict
from
mmengine
.config
import
ConfigDict
from
mmengine.model
import
BaseModule
,
ModuleList
,
Sequential
from
mmengine.model
import
BaseModule
,
ModuleList
,
Sequential
from
mmengine.registry
import
MODELS
from
mmengine.registry
import
MODELS
from
mmengine.utils
import
deprecated_api_warning
,
to_2tuple
from
mmengine.utils
import
deprecated_api_warning
,
to_2tuple
...
...
mmcv/cnn/bricks/upsample.py
View file @
c3835415
...
@@ -4,7 +4,7 @@ from typing import Dict
...
@@ -4,7 +4,7 @@ from typing import Dict
import
torch
import
torch
import
torch.nn
as
nn
import
torch.nn
as
nn
import
torch.nn.functional
as
F
import
torch.nn.functional
as
F
from
mmengine.model
.utils
import
xavier_init
from
mmengine.model
import
xavier_init
from
mmengine.registry
import
MODELS
from
mmengine.registry
import
MODELS
MODELS
.
register_module
(
'nearest'
,
module
=
nn
.
Upsample
)
MODELS
.
register_module
(
'nearest'
,
module
=
nn
.
Upsample
)
...
...
mmcv/cnn/resnet.py
View file @
c3835415
...
@@ -4,7 +4,7 @@ from typing import Optional, Sequence, Tuple, Union
...
@@ -4,7 +4,7 @@ from typing import Optional, Sequence, Tuple, Union
import
torch.nn
as
nn
import
torch.nn
as
nn
import
torch.utils.checkpoint
as
cp
import
torch.utils.checkpoint
as
cp
from
mmengine.model
.utils
import
constant_init
,
kaiming_init
from
mmengine.model
import
constant_init
,
kaiming_init
from
mmengine.runner
import
load_checkpoint
from
mmengine.runner
import
load_checkpoint
from
torch
import
Tensor
from
torch
import
Tensor
...
...
mmcv/cnn/vgg.py
View file @
c3835415
...
@@ -3,7 +3,7 @@ import logging
...
@@ -3,7 +3,7 @@ import logging
from
typing
import
List
,
Optional
,
Sequence
,
Tuple
,
Union
from
typing
import
List
,
Optional
,
Sequence
,
Tuple
,
Union
import
torch.nn
as
nn
import
torch.nn
as
nn
from
mmengine.model
.utils
import
constant_init
,
kaiming_init
,
normal_init
from
mmengine.model
import
constant_init
,
kaiming_init
,
normal_init
from
mmengine.runner
import
load_checkpoint
from
mmengine.runner
import
load_checkpoint
from
torch
import
Tensor
from
torch
import
Tensor
...
...
mmcv/ops/carafe.py
View file @
c3835415
...
@@ -4,7 +4,7 @@ from typing import Tuple
...
@@ -4,7 +4,7 @@ from typing import Tuple
import
torch
import
torch
import
torch.nn
as
nn
import
torch.nn
as
nn
import
torch.nn.functional
as
F
import
torch.nn.functional
as
F
from
mmengine.model
.utils
import
normal_init
,
xavier_init
from
mmengine.model
import
normal_init
,
xavier_init
from
mmengine.registry
import
MODELS
from
mmengine.registry
import
MODELS
from
torch
import
Tensor
from
torch
import
Tensor
from
torch.autograd
import
Function
from
torch.autograd
import
Function
...
...
mmcv/ops/deform_conv.py
View file @
c3835415
...
@@ -4,7 +4,7 @@ from typing import Optional, Tuple, Union
...
@@ -4,7 +4,7 @@ from typing import Optional, Tuple, Union
import
torch
import
torch
import
torch.nn
as
nn
import
torch.nn
as
nn
import
torch.nn.functional
as
F
import
torch.nn.functional
as
F
from
mmengine
import
print_log
from
mmengine
.logging
import
print_log
from
mmengine.registry
import
MODELS
from
mmengine.registry
import
MODELS
from
mmengine.utils
import
deprecated_api_warning
from
mmengine.utils
import
deprecated_api_warning
from
torch
import
Tensor
from
torch
import
Tensor
...
...
mmcv/ops/modulated_deform_conv.py
View file @
c3835415
...
@@ -4,7 +4,7 @@ from typing import Optional, Tuple, Union
...
@@ -4,7 +4,7 @@ from typing import Optional, Tuple, Union
import
torch
import
torch
import
torch.nn
as
nn
import
torch.nn
as
nn
from
mmengine
import
print_log
from
mmengine
.logging
import
print_log
from
mmengine.registry
import
MODELS
from
mmengine.registry
import
MODELS
from
mmengine.utils
import
deprecated_api_warning
from
mmengine.utils
import
deprecated_api_warning
from
torch.autograd
import
Function
from
torch.autograd
import
Function
...
...
mmcv/ops/multi_scale_deform_attn.py
View file @
c3835415
...
@@ -7,8 +7,7 @@ import mmengine
...
@@ -7,8 +7,7 @@ import mmengine
import
torch
import
torch
import
torch.nn
as
nn
import
torch.nn
as
nn
import
torch.nn.functional
as
F
import
torch.nn.functional
as
F
from
mmengine.model
import
BaseModule
from
mmengine.model
import
BaseModule
,
constant_init
,
xavier_init
from
mmengine.model.utils
import
constant_init
,
xavier_init
from
mmengine.registry
import
MODELS
from
mmengine.registry
import
MODELS
from
mmengine.utils
import
deprecated_api_warning
from
mmengine.utils
import
deprecated_api_warning
from
torch.autograd.function
import
Function
,
once_differentiable
from
torch.autograd.function
import
Function
,
once_differentiable
...
...
mmcv/ops/saconv.py
View file @
c3835415
...
@@ -2,9 +2,10 @@
...
@@ -2,9 +2,10 @@
import
torch
import
torch
import
torch.nn
as
nn
import
torch.nn
as
nn
import
torch.nn.functional
as
F
import
torch.nn.functional
as
F
from
mmengine.model
.utils
import
constant_init
from
mmengine.model
import
constant_init
from
mmengine.registry
import
MODELS
from
mmengine.registry
import
MODELS
from
mmengine.utils
import
TORCH_VERSION
,
digit_version
from
mmengine.utils
import
digit_version
from
mmengine.utils.dl_utils
import
TORCH_VERSION
from
mmcv.cnn
import
ConvAWS2d
from
mmcv.cnn
import
ConvAWS2d
from
mmcv.ops.deform_conv
import
deform_conv2d
from
mmcv.ops.deform_conv
import
deform_conv2d
...
...
mmcv/utils/env.py
View file @
c3835415
# Copyright (c) OpenMMLab. All rights reserved.
# Copyright (c) OpenMMLab. All rights reserved.
"""This file holding some environment constant for sharing by other files."""
"""This file holding some environment constant for sharing by other files."""
from
mmengine.utils
import
collect_env
as
mmengine_collect_env
from
mmengine.utils
.dl_utils
import
collect_env
as
mmengine_collect_env
import
mmcv
import
mmcv
...
...
mmcv/utils/parrots_jit.py
View file @
c3835415
# Copyright (c) OpenMMLab. All rights reserved.
# Copyright (c) OpenMMLab. All rights reserved.
import
os
import
os
from
mmengine.utils.parrots_wrapper
import
TORCH_VERSION
from
mmengine.utils.
dl_utils.
parrots_wrapper
import
TORCH_VERSION
parrots_jit_option
=
os
.
getenv
(
'PARROTS_JIT_OPTION'
)
parrots_jit_option
=
os
.
getenv
(
'PARROTS_JIT_OPTION'
)
...
...
tests/test_cnn/test_build_layers.py
View file @
c3835415
...
@@ -6,7 +6,7 @@ import pytest
...
@@ -6,7 +6,7 @@ import pytest
import
torch
import
torch
import
torch.nn
as
nn
import
torch.nn
as
nn
from
mmengine.registry
import
MODELS
from
mmengine.registry
import
MODELS
from
mmengine.utils.parrots_wrapper
import
_BatchNorm
from
mmengine.utils.
dl_utils.
parrots_wrapper
import
_BatchNorm
from
mmcv.cnn.bricks
import
(
build_activation_layer
,
build_conv_layer
,
from
mmcv.cnn.bricks
import
(
build_activation_layer
,
build_conv_layer
,
build_norm_layer
,
build_padding_layer
,
build_norm_layer
,
build_padding_layer
,
...
...
tests/test_cnn/test_conv_module.py
View file @
c3835415
...
@@ -6,7 +6,8 @@ import pytest
...
@@ -6,7 +6,8 @@ import pytest
import
torch
import
torch
import
torch.nn
as
nn
import
torch.nn
as
nn
from
mmengine.registry
import
MODELS
from
mmengine.registry
import
MODELS
from
mmengine.utils
import
TORCH_VERSION
,
digit_version
from
mmengine.utils
import
digit_version
from
mmengine.utils.dl_utils
import
TORCH_VERSION
from
mmcv.cnn.bricks
import
ConvModule
,
HSigmoid
,
HSwish
from
mmcv.cnn.bricks
import
ConvModule
,
HSigmoid
,
HSwish
...
...
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment