Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apex is not installed AttributeError: module 'torch.distributed' has no attribute '_reduce_scatter_base' #218

Open
QY1994-0919 opened this issue Sep 16, 2023 · 0 comments

Comments

@QY1994-0919
Copy link

python tools/train.py --config configs/swin/mask_rcnn_swin_small_patch4_window7_mstrain_480-800_adamw_3x_coco.py --cfg-options model.pretrained=weights/swin_base_patch4_window7_224.pth
apex is not installed
Traceback (most recent call last):
File "tools/train.py", line 15, in
from mmdet.apis import set_random_seed, train_detector
File "/opt/data/private/Models_ours/Swin-Transformer-OD/mmdet/apis/init.py", line 1, in
from .inference import (async_inference_detector, inference_detector,
File "/opt/data/private/Models_ours/Swin-Transformer-OD/mmdet/apis/inference.py", line 11, in
from mmdet.datasets import replace_ImageToTensor
File "/opt/data/private/Models_ours/Swin-Transformer-OD/mmdet/datasets/init.py", line 10, in
from .utils import (NumClassCheckHook, get_loading_pipeline,
File "/opt/data/private/Models_ours/Swin-Transformer-OD/mmdet/datasets/utils.py", line 9, in
from mmdet.models.dense_heads import GARPNHead, RPNHead
File "/opt/data/private/Models_ours/Swin-Transformer-OD/mmdet/models/init.py", line 1, in
from .backbones import * # noqa: F401,F403
File "/opt/data/private/Models_ours/Swin-Transformer-OD/mmdet/models/backbones/init.py", line 13, in
from .swin_transformer import SwinTransformer
File "/opt/data/private/Models_ours/Swin-Transformer-OD/mmdet/models/backbones/swin_transformer.py", line 13, in
from timm.models.layers import DropPath, to_2tuple, trunc_normal_
File "/root/anaconda3/envs/torch19/lib/python3.8/site-packages/timm/init.py", line 2, in
from .models import create_model, list_models, is_model, list_modules, model_entrypoint,
File "/root/anaconda3/envs/torch19/lib/python3.8/site-packages/timm/models/init.py", line 1, in
from .beit import *
File "/root/anaconda3/envs/torch19/lib/python3.8/site-packages/timm/models/beit.py", line 49, in
from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
File "/root/anaconda3/envs/torch19/lib/python3.8/site-packages/timm/data/init.py", line 5, in
from .dataset import ImageDataset, IterableImageDataset, AugMixDataset
File "/root/anaconda3/envs/torch19/lib/python3.8/site-packages/timm/data/dataset.py", line 12, in
from .parsers import create_parser
File "/root/anaconda3/envs/torch19/lib/python3.8/site-packages/timm/data/parsers/init.py", line 1, in
from .parser_factory import create_parser
File "/root/anaconda3/envs/torch19/lib/python3.8/site-packages/timm/data/parsers/parser_factory.py", line 3, in
from .parser_image_folder import ParserImageFolder
File "/root/anaconda3/envs/torch19/lib/python3.8/site-packages/timm/data/parsers/parser_image_folder.py", line 11, in
from timm.utils.misc import natural_key
File "/root/anaconda3/envs/torch19/lib/python3.8/site-packages/timm/utils/init.py", line 4, in
from .cuda import ApexScaler, NativeScaler
File "/root/anaconda3/envs/torch19/lib/python3.8/site-packages/timm/utils/cuda.py", line 8, in
from apex import amp
File "/root/anaconda3/envs/torch19/lib/python3.8/site-packages/apex/init.py", line 27, in
from . import transformer
File "/root/anaconda3/envs/torch19/lib/python3.8/site-packages/apex/transformer/init.py", line 4, in
from apex.transformer import pipeline_parallel
File "/root/anaconda3/envs/torch19/lib/python3.8/site-packages/apex/transformer/pipeline_parallel/init.py", line 1, in
from apex.transformer.pipeline_parallel.schedules import get_forward_backward_func
File "/root/anaconda3/envs/torch19/lib/python3.8/site-packages/apex/transformer/pipeline_parallel/schedules/init.py", line 3, in
from apex.transformer.pipeline_parallel.schedules.fwd_bwd_no_pipelining import (
File "/root/anaconda3/envs/torch19/lib/python3.8/site-packages/apex/transformer/pipeline_parallel/schedules/fwd_bwd_no_pipelining.py", line 10, in
from apex.transformer.pipeline_parallel.schedules.common import Batch
File "/root/anaconda3/envs/torch19/lib/python3.8/site-packages/apex/transformer/pipeline_parallel/schedules/common.py", line 14, in
from apex.transformer.tensor_parallel.layers import (
File "/root/anaconda3/envs/torch19/lib/python3.8/site-packages/apex/transformer/tensor_parallel/init.py", line 21, in
from apex.transformer.tensor_parallel.layers import (
File "/root/anaconda3/envs/torch19/lib/python3.8/site-packages/apex/transformer/tensor_parallel/layers.py", line 32, in
from apex.transformer.tensor_parallel.mappings import (
File "/root/anaconda3/envs/torch19/lib/python3.8/site-packages/apex/transformer/tensor_parallel/mappings.py", line 29, in
torch.distributed.reduce_scatter_tensor = torch.distributed._reduce_scatter_base
AttributeError: module 'torch.distributed' has no attribute '_reduce_scatter_base'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant