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

(open-mmlab) root@ncut-vServer-Evc:~/myproject/SETR# python tools/test.py configs/SETR/SETR_MLA_480x480_80k_pascal_context_bs_8_MS.py iter_80000.pth --eval mIoU --show-dir output 2021-04-19 16:36:47,064 - mmseg - INFO - Loaded 1 images load pre-trained weight from imagenet21k [ ] 0/1, elapsed: 0s, ETA:Traceback (most recent call last): File "tools/test.py", line 151, in <module> main() File "tools/test.py", line 128, in main outputs = single_gpu_test(model, data_loader, args.show, args.show_dir) File "/root/SETR/mmseg/apis/test.py", line 62, in single_gpu_test out_file=out_file) File "/root/SETR/mmseg/models/segmentors/base.py", line 246, in show_result assert palette.shape[0] == len(self.CLASSES) #494

Closed
miaochunle opened this issue Apr 19, 2021 · 5 comments

Comments

@miaochunle
Copy link

(open-mmlab) root@ncut-vServer-Evc:~/myproject/SETR# python tools/test.py configs/SETR/SETR_MLA_480x480_80k_pascal_context_bs_8_MS.py iter_80000.pth --eval mIoU --show-dir output
2021-04-19 16:36:47,064 - mmseg - INFO - Loaded 1 images
load pre-trained weight from imagenet21k
[ ] 0/1, elapsed: 0s, ETA:Traceback (most recent call last):
File "tools/test.py", line 151, in
main()
File "tools/test.py", line 128, in main
outputs = single_gpu_test(model, data_loader, args.show, args.show_dir)
File "/root/SETR/mmseg/apis/test.py", line 62, in single_gpu_test
out_file=out_file)
File "/root/SETR/mmseg/models/segmentors/base.py", line 246, in show_result
assert palette.shape[0] == len(self.CLASSES)

@clownrat6
Copy link
Contributor

Eh, can you post out your SETR config file?

@clownrat6
Copy link
Contributor

If there is no response, I will close this issue. The official support of SETR will come soon. Thank you.

@vgg4resnet
Copy link

same question here, I used the cmd : python demo/image_demo.py demo/demo.png configs/segformer/segformer_mit-b0_512x512_160k_ade20k.py https://download.openmmlab.com/mmsegmentation/v0.5/segformer/segformer_mit-b0_512x512_160k_ade20k/segformer_mit-b0_512x512_160k_ade20k_20210726_101530-8ffa8fda.pth --device cuda:0 --palette cityscapes

@vgg4resnet
Copy link

get fixed by changing the --palette cityscapes to --palette ade

@SuhZhang
Copy link

get fixed by changing the --palette cityscapes to --palette ade

I met the same problem as you @vgg4resnet, and I tried to use the cmd:
python demo/image_demo.py demo/demo.png configs/swin/upernet_swin_base_patch4_window7_512x1024_80k.py checkpoint/swin_base_iter_80000.pth --device cuda:0 --palette ade
It still didn't work:

Use load_from_local loader
Traceback (most recent call last):
  File "demo/image_demo.py", line 29, in <module>
    main()
  File "demo/image_demo.py", line 25, in main
    show_result_pyplot(model, args.img, result, get_palette(args.palette))
  File "/root/zsh5/foodseg/Swin-Transformer-Semantic-Segmentation/mmseg/apis/inference.py", line 115, in show_result_pyplot
    img = model.show_result(img, result, palette=palette, show=False)
  File "/root/zsh5/foodseg/Swin-Transformer-Semantic-Segmentation/mmseg/models/segmentors/base.py", line 246, in show_result
    assert palette.shape[0] == len(self.CLASSES)
TypeError: object of type 'NoneType' has no len()

Here is my environment:

sys.platform: linux
Python: 3.7.11 (default, Jul 27 2021, 14:32:16) [GCC 7.5.0]
CUDA available: True
GPU 0: GeForce GTX 1080 Ti
CUDA_HOME: /usr/local/cuda
NVCC: Cuda compilation tools, release 10.1, V10.1.243
GCC: gcc (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609
PyTorch: 1.6.0
PyTorch compiling details: PyTorch built with:
  - GCC 7.3
  - C++ Version: 201402
  - Intel(R) oneAPI Math Kernel Library Version 2021.3-Product Build 20210617 for Intel(R) 64 architecture applications
  - Intel(R) MKL-DNN v1.5.0 (Git Hash e2ac1fac44c5078ca927cb9b90e1b3066a0b2ed0)
  - 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_61,code=sm_61;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_75,code=sm_75;-gencode;arch=compute_37,code=compute_37
  - 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-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, USE_STATIC_DISPATCH=OFF, 

TorchVision: 0.7.0
OpenCV: 4.5.3
MMCV: 1.3.0
MMCV Compiler: GCC 5.4
MMCV CUDA Compiler: 10.1
MMSegmentation: 0.11.0+dcdd544

How can I fix the problem? Thx.

aravind-h-v pushed a commit to aravind-h-v/mmsegmentation that referenced this issue Mar 27, 2023
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

4 participants