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

ImportError: cannot import name 'Dict' from 'typing' (/root/mmsegmentation/mmseg/utils/typing.py) #2547

Closed
zccjjj opened this issue Feb 1, 2023 · 3 comments
Assignees

Comments

@zccjjj
Copy link
Contributor

zccjjj commented Feb 1, 2023

Thanks for your error report and we appreciate it a lot.

Checklist

  1. I have searched related issues but cannot get the expected help.
  2. The bug has not been fixed in the latest version.

Describe the bug
When I run collect_evn.py in branch dev-1.x, this error occurred.

Reproduction

  1. What command or script did you run?

python ./mmseg/utils/collect_env.py

Bug fix

I renamed the typing.py and fixed the bug. I will create a PR for it.
Thanks very much!

@MeowZheng
Copy link
Collaborator

MeowZheng commented Feb 1, 2023

Thanks for your bug reporting!

Would you like to share the error log, as I didn't meet any errors when run python ./mmseg/utils/collect_env.py.

@zccjjj
Copy link
Contributor Author

zccjjj commented Feb 1, 2023

Thanks for your bug reporting!

Would you like to share the error log, as I didn't meet any errors when run python ./mmseg/utils/collect_env.py.

Yes!
Here is the error log.

Traceback (most recent call last):
  File "./mmseg/utils/collect_env.py", line 2, in <module>
    from mmengine.utils import get_git_hash
  File "/root/anaconda3/envs/mmlab2/lib/python3.7/site-packages/mmengine/__init__.py", line 3, in <module>
    from .config import *
  File "/root/anaconda3/envs/mmlab2/lib/python3.7/site-packages/mmengine/config/__init__.py", line 2, in <module>
    from .config import Config, ConfigDict, DictAction
  File "/root/anaconda3/envs/mmlab2/lib/python3.7/site-packages/mmengine/config/config.py", line 15, in <module>
    from typing import Any, Optional, Sequence, Tuple, Union
  File "/root/mmsegmentation/mmseg/utils/typing.py", line 3, in <module>
    from typing import Dict, List, Optional, Sequence, Tuple, Union
ImportError: cannot import name 'Dict' from 'typing' (/root/mmsegmentation/mmseg/utils/typing.py)

And here are the results I got after I fixed the bug.

sys.platform: linux
Python: 3.7.12 | packaged by conda-forge | (default, Oct 26 2021, 06:08:21) [GCC 9.4.0]
CUDA available: True
numpy_random_seed: 2147483648
GPU 0,1,2,3,4,5,6,7: GeForce RTX 2080 Ti
CUDA_HOME: /usr/local/cuda
NVCC: Cuda compilation tools, release 10.0, V10.0.13
GCC: gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
PyTorch: 1.7.0+cu101
PyTorch compiling details: PyTorch built with:
  - GCC 7.3
  - C++ Version: 201402
  - Intel(R) Math Kernel Library Version 2020.0.0 Product Build 20191122 for Intel(R) 64 architecture applications
  - Intel(R) MKL-DNN v1.6.0 (Git Hash 5ef631a030a6f73131c77892041042805a06064f)
  - OpenMP 201511 (a.k.a. OpenMP 4.5)
  - NNPACK is enabled
  - CPU capability usage: AVX2
  - CUDA Runtime 10.1
  - NVCC architecture flags: -gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_75,code=sm_75
  - CuDNN 7.6.3
  - Magma 2.5.2
  - Build settings: BLAS=MKL, BUILD_TYPE=Release, CXX_FLAGS= -Wno-deprecated -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DUSE_VULKAN_WRAPPER -O2 -fPIC -Wno-narrowing -Wall -Wextra -Werror=return-type -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-unused-result -Wno-unused-local-typedefs -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-stringop-overflow -Wno-psabi -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -fdiagnostics-color=always -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -Wno-stringop-overflow, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, USE_CUDA=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=ON, USE_NNPACK=ON, USE_OPENMP=ON,

TorchVision: 0.8.1+cu101
OpenCV: 4.7.0
MMEngine: 0.5.0
MMSegmentation: 1.0.0rc4+698dee9

MeowZheng pushed a commit that referenced this issue Feb 1, 2023
## Motivation

Fix the bug in running ```collect_evn.py```. #2547 

## Modification

Rename typing.py to typing_utils.py
@MeowZheng
Copy link
Collaborator

I see, #2548 has been merged :)

aravind-h-v pushed a commit to aravind-h-v/mmsegmentation that referenced this issue Mar 27, 2023
* move dbooth github stuff to docs

* add notebooks

* 🖍 minor shuffle

* 🖍 fix markdown table

* 🖍 apply feedback

* ✨ make style

* 🖍 minor fix in code snippet
nahidnazifi87 pushed a commit to nahidnazifi87/mmsegmentation_playground that referenced this issue Apr 5, 2024
## Motivation

Fix the bug in running ```collect_evn.py```. open-mmlab#2547 

## Modification

Rename typing.py to typing_utils.py
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

2 participants