mmdet in orin : No module named 'torch._C._distributed_c10d'; 'torch._C' is not a package
AugWrite opened this issue · 0 comments
I tried to deploy the mmdet framework on Orin. After installation, the version output is normal, but when executing the code to initialize the references, the following error occurs. However, it seems that the installation is not the issue, and it has already been successfully installed?
check version:
python -c "import torch, torchvision, mmcv, mmdet; print(f'Torch Version: {torch.version}'); print(f'Torch CUDA Version: {torch.version.cuda}'); print(f'Torchvision Version: {torchvision.version}'); print(f'MMCV Version: {mmcv.version}'); print(f'MMDetection Version: {mmdet.version}')"
Torch Version: 2.1.0a0+41361538.nv23.06
Torch CUDA Version: 11.4
Torchvision Version: 0.16.1
MMCV Version: 2.0.0
MMDetection Version: 3.3.0
error:
ceback (most recent call last):
File "/home/nvidia/zd/wk/devel/lib/viplanner_node/viplanner_node.py", line 15, in
exec(compile(fh.read(), python_script, 'exec'), context)
File "/home/nvidia/zd/wk/src/ros/planner/src/viplanner_node.py", line 41, in
from src.m2f_inference import Mask2FormerInference
File "/home/nvidia/zd/wk/src/ros/planner/src/m2f_inference.py", line 12, in
from mmdet.apis import inference_detector, init_detector
File "/home/nvidia/zd/miniconda3/envs/py3810/lib/python3.8/site-packages/mmdet/apis/init.py", line 2, in
from .det_inferencer import DetInferencer
File "/home/nvidia/zd/miniconda3/envs/py3810/lib/python3.8/site-packages/mmdet/apis/det_inferencer.py", line 15, in
from mmengine.infer.infer import BaseInferencer, ModelType
File "/home/nvidia/zd/miniconda3/envs/py3810/lib/python3.8/site-packages/mmengine/infer/init.py", line 2, in
from .infer import BaseInferencer
File "/home/nvidia/zd/miniconda3/envs/py3810/lib/python3.8/site-packages/mmengine/infer/infer.py", line 25, in
from mmengine.runner.checkpoint import (_load_checkpoint,
File "/home/nvidia/zd/miniconda3/envs/py3810/lib/python3.8/site-packages/mmengine/runner/init.py", line 2, in
from ._flexible_runner import FlexibleRunner
File "/home/nvidia/zd/miniconda3/envs/py3810/lib/python3.8/site-packages/mmengine/runner/_flexible_runner.py", line 14, in
from mmengine._strategy import BaseStrategy
File "/home/nvidia/zd/miniconda3/envs/py3810/lib/python3.8/site-packages/mmengine/_strategy/init.py", line 4, in
from .base import BaseStrategy
File "/home/nvidia/zd/miniconda3/envs/py3810/lib/python3.8/site-packages/mmengine/_strategy/base.py", line 19, in
from mmengine.model.wrappers import is_model_wrapper
File "/home/nvidia/zd/miniconda3/envs/py3810/lib/python3.8/site-packages/mmengine/model/init.py", line 6, in
from .base_model import BaseDataPreprocessor, BaseModel, ImgDataPreprocessor
File "/home/nvidia/zd/miniconda3/envs/py3810/lib/python3.8/site-packages/mmengine/model/base_model/init.py", line 2, in
from .base_model import BaseModel
File "/home/nvidia/zd/miniconda3/envs/py3810/lib/python3.8/site-packages/mmengine/model/base_model/base_model.py", line 12, in
from ..base_module import BaseModule
File "/home/nvidia/zd/miniconda3/envs/py3810/lib/python3.8/site-packages/mmengine/model/base_module.py", line 14, in
from .wrappers.utils import is_model_wrapper
File "/home/nvidia/zd/miniconda3/envs/py3810/lib/python3.8/site-packages/mmengine/model/wrappers/init.py", line 14, in
from .fully_sharded_distributed import
File "/home/nvidia/zd/miniconda3/envs/py3810/lib/python3.8/site-packages/mmengine/model/wrappers/fully_sharded_distributed.py", line 10, in
from torch.distributed.fsdp.api import (FullStateDictConfig,
File "/home/nvidia/.local/lib/python3.8/site-packages/torch/distributed/fsdp/init.py", line 1, in
from .flat_param import FlatParameter
File "/home/nvidia/.local/lib/python3.8/site-packages/torch/distributed/fsdp/flat_param.py", line 30, in
from torch.distributed._tensor import DTensor
File "/home/nvidia/.local/lib/python3.8/site-packages/torch/distributed/_tensor/init.py", line 6, in
import torch.distributed._tensor.ops
File "/home/nvidia/.local/lib/python3.8/site-packages/torch/distributed/_tensor/ops/init.py", line 2, in
from .embedding_ops import * # noqa: F403
File "/home/nvidia/.local/lib/python3.8/site-packages/torch/distributed/_tensor/ops/embedding_ops.py", line 6, in
from torch.distributed._tensor.api import _Partial, DTensorSpec, Replicate, Shard
File "/home/nvidia/.local/lib/python3.8/site-packages/torch/distributed/_tensor/api.py", line 8, in
import torch.distributed._tensor.dispatch as op_dispatch
File "/home/nvidia/.local/lib/python3.8/site-packages/torch/distributed/_tensor/dispatch.py", line 10, in
from torch.distributed._tensor.device_mesh import DeviceMesh
File "/home/nvidia/.local/lib/python3.8/site-packages/torch/distributed/_tensor/device_mesh.py", line 6, in
import torch.distributed._functional_collectives as funcol
File "/home/nvidia/.local/lib/python3.8/site-packages/torch/distributed/_functional_collectives.py", line 7, in
import torch.distributed.distributed_c10d as c10d
File "/home/nvidia/.local/lib/python3.8/site-packages/torch/distributed/distributed_c10d.py", line 17, in
from torch._C._distributed_c10d import (
ModuleNotFoundError: No module named 'torch._C._distributed_c10d'; 'torch._C' is not a package