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

About Reproducing Training of Remote Sensing Semantic Segmentation Models #4

Open
smallsnailrunning opened this issue Jun 10, 2022 · 9 comments

Comments

@smallsnailrunning
Copy link

Hello, I am interested in the remote sensing semantic segmentation of this project. I have downloaded all the relevant Potsdam datasets and configured the program running environment, but the reproduction steps of the entire training are still unclear. The downloaded public datasets Whether preprocessing is required, images and label images need to be cut into small pieces. If you don't do distributed training, you can simply remove the distributed settings when training on one card. Do you have a more detailed description of the training steps? The description of the training parameter configuration config file allows us to reproduce the model training. Thank you.

@DotWang
Copy link
Collaborator

DotWang commented Jun 10, 2022

The original Potsdam image is large, so it is needed to be clipped to patches. For preparing the Potsdam dataset, you can refer to https://github.com/open-mmlab/mmsegmentation/blob/master/docs/en/dataset_prepare.md#prepare-datasets. Note there are some differences. We use '3_Ortho_IRRG.zip' and '5_Labels_all.zip'.

For reproduction, we have provided the command lines, config files, training logs, and saved model weights in the readme.md of https://github.com/ViTAE-Transformer/ViTAE-Transformer-Remote-Sensing/tree/main/Semantic%20Segmentation.

As I know, the default mmsegmentation adopts the distributed training. It doesn't affect the final result.

@smallsnailrunning
Copy link
Author

Thank you, I have a try as you say. Hope to see the amazing results. your jop is very meaning.

@smallsnailrunning
Copy link
Author

smallsnailrunning commented Jun 11, 2022

I tried the proiect in the windows, not in the linux, Did you have a try in the windows?It semms to be the problem about the path '\' in windows '/' in the linux, except the problem, I am not sure if there will have other problems between the difference in th windows and linux system, do you have a project with the windows edition?

@smallsnailrunning

This comment was marked as abuse.

@smallsnailrunning
Copy link
Author

smallsnailrunning commented Jun 11, 2022

(rs) C:\Users\ly\PycharmProjects\ViTAE-Transformer-Remote-Sensing-main\Semantic Segmentation>python tools\test.py configs\swin\upernet_swin_tiny_patch4_window7_512x512_80k_potsdam.py --show-dir data\te
st --eval mIoU 'mFscore'
usage: test.py [-h] [--work-dir WORK_DIR] [--aug-test] [--out OUT] [--format-only] [--eval EVAL [EVAL ...]] [--show] [--show-dir SHOW_DIR] [--gpu-collect] [--gpu-id GPU_ID] [--tmpdir TMPDIR]
[--options OPTIONS [OPTIONS ...]] [--cfg-options CFG_OPTIONS [CFG_OPTIONS ...]] [--eval-options EVAL_OPTIONS [EVAL_OPTIONS ...]] [--launcher {none,pytorch,slurm,mpi}] [--opacity OPACITY]
[--local_rank LOCAL_RANK]
config checkpoint
test.py: error: the following arguments are required: checkpoint

I directly adjusted the configuration file according to the file structure of my computer under the windows system: configs, I used the pre-trained model you uploaded for the inference test, the above error occurred, and there are some problems. I don't know how to fix the problem? I need your help very much, thank you very much, there may be trouble in the future, and I am trying to reproduce the whole project myself. thank you very much

@DotWang
Copy link
Collaborator

DotWang commented Jun 11, 2022

Sorry, we have not tried it on the windows yet.

I think you can try “\\" in shell, but I'm not sure whether it works

If the path is in python, you can try r'C:\Users\ly\PycharmProjects\xxxx'

Also, you can search for similar problems in the mmsegmentation issue.

@smallsnailrunning
Copy link
Author

(rs) C:\Users\ly\PycharmProjects\ViTAE-Transformer-Remote-Sensing-main\Semantic Segmentation>python tools\test.py configs\swin\upernet_swin_tiny_patch4_window7_512x512_80k_potsdam.py --show-dir data\test\
--eval mIoU 'mFscore'
usage: test.py [-h] [--work-dir WORK_DIR] [--aug-test] [--out OUT] [--format-only] [--eval EVAL [EVAL ...]] [--show] [--show-dir SHOW_DIR] [--gpu-collect] [--gpu-id GPU_ID] [--tmpdir TMPDIR]
[--options OPTIONS [OPTIONS ...]] [--cfg-options CFG_OPTIONS [CFG_OPTIONS ...]] [--eval-options EVAL_OPTIONS [EVAL_OPTIONS ...]] [--launcher {none,pytorch,slurm,mpi}] [--opacity OPACITY]
[--local_rank LOCAL_RANK]
config checkpoint
test.py: error: the following arguments are required: checkpoint

(rs) C:\Users\ly\PycharmProjects\ViTAE-Transformer-Remote-Sensing-main\Semantic Segmentation>
File "C:\Users\ly\PycharmProjects\ViTAE-Transformer-Remote-Sensing-main\Semantic Segmentation\tools\test.py", line 303, in
main()
File "C:\Users\ly\PycharmProjects\ViTAE-Transformer-Remote-Sensing-main\Semantic Segmentation\tools\test.py", line 203, in main
model = build_segmentor(cfg.model, test_cfg=cfg.get('test_cfg'))
File "C:\Users\ly\anaconda3\envs\rs\lib\site-packages\mmseg\models\builder.py", line 48, in build_segmentor
return SEGMENTORS.build(
File "C:\Users\ly\anaconda3\envs\rs\lib\site-packages\mmcv\utils\registry.py", line 234, in build
return self.build_func(*args, **kwargs, registry=self)
File "C:\Users\ly\anaconda3\envs\rs\lib\site-packages\mmcv\cnn\builder.py", line 27, in build_model_from_cfg
return build_from_cfg(cfg, registry, default_args)
File "C:\Users\ly\anaconda3\envs\rs\lib\site-packages\mmcv\utils\registry.py", line 69, in build_from_cfg
raise type(e)(f'{obj_cls.name}: {e}')
KeyError: "EncoderDecoder: 'swin is not in the models registry'"

I tried,have the problem ,can you have a look ,thanks, I do not knows why I clone the project , swin is not in the models registry? very thanks if you know the reason, tell me how to solve the problem

@smallsnailrunning
Copy link
Author

(rs) C:\Users\ly\PycharmProjects\ViTAE-Transformer-Remote-Sensing-main\Semantic Segmentation>python tools\test.py configs\swin\upernet_swin_tiny_patch4_window7_512x512_80k_potsdam.py --show-dir data\te st --eval mIoU 'mFscore' usage: test.py [-h] [--work-dir WORK_DIR] [--aug-test] [--out OUT] [--format-only] [--eval EVAL [EVAL ...]] [--show] [--show-dir SHOW_DIR] [--gpu-collect] [--gpu-id GPU_ID] [--tmpdir TMPDIR] [--options OPTIONS [OPTIONS ...]] [--cfg-options CFG_OPTIONS [CFG_OPTIONS ...]] [--eval-options EVAL_OPTIONS [EVAL_OPTIONS ...]] [--launcher {none,pytorch,slurm,mpi}] [--opacity OPACITY] [--local_rank LOCAL_RANK] config checkpoint test.py: error: the following arguments are required: checkpoint

I directly adjusted the configuration file according to the file structure of my computer under the windows system: configs, I used the pre-trained model you uploaded for the inference test, the above error occurred, and there are some problems. I don't know how to fix the problem? I need your help very much, thank you very much, there may be trouble in the future, and I am trying to reproduce the whole project myself. thank you very much

I know I miss the .pth file

@DotWang
Copy link
Collaborator

DotWang commented Jun 19, 2022

(rs) C:\Users\ly\PycharmProjects\ViTAE-Transformer-Remote-Sensing-main\Semantic Segmentation>python tools\test.py configs\swin\upernet_swin_tiny_patch4_window7_512x512_80k_potsdam.py --show-dir data\test\ --eval mIoU 'mFscore' usage: test.py [-h] [--work-dir WORK_DIR] [--aug-test] [--out OUT] [--format-only] [--eval EVAL [EVAL ...]] [--show] [--show-dir SHOW_DIR] [--gpu-collect] [--gpu-id GPU_ID] [--tmpdir TMPDIR] [--options OPTIONS [OPTIONS ...]] [--cfg-options CFG_OPTIONS [CFG_OPTIONS ...]] [--eval-options EVAL_OPTIONS [EVAL_OPTIONS ...]] [--launcher {none,pytorch,slurm,mpi}] [--opacity OPACITY] [--local_rank LOCAL_RANK] config checkpoint test.py: error: the following arguments are required: checkpoint

(rs) C:\Users\ly\PycharmProjects\ViTAE-Transformer-Remote-Sensing-main\Semantic Segmentation> File "C:\Users\ly\PycharmProjects\ViTAE-Transformer-Remote-Sensing-main\Semantic Segmentation\tools\test.py", line 303, in main() File "C:\Users\ly\PycharmProjects\ViTAE-Transformer-Remote-Sensing-main\Semantic Segmentation\tools\test.py", line 203, in main model = build_segmentor(cfg.model, test_cfg=cfg.get('test_cfg')) File "C:\Users\ly\anaconda3\envs\rs\lib\site-packages\mmseg\models\builder.py", line 48, in build_segmentor return SEGMENTORS.build( File "C:\Users\ly\anaconda3\envs\rs\lib\site-packages\mmcv\utils\registry.py", line 234, in build return self.build_func(*args, **kwargs, registry=self) File "C:\Users\ly\anaconda3\envs\rs\lib\site-packages\mmcv\cnn\builder.py", line 27, in build_model_from_cfg return build_from_cfg(cfg, registry, default_args) File "C:\Users\ly\anaconda3\envs\rs\lib\site-packages\mmcv\utils\registry.py", line 69, in build_from_cfg raise type(e)(f'{obj_cls.name}: {e}') KeyError: "EncoderDecoder: 'swin is not in the models registry'"

I tried,have the problem ,can you have a look ,thanks, I do not knows why I clone the project , swin is not in the models registry? very thanks if you know the reason, tell me how to solve the problem

'swin' is already contained in __init__.py, so can you post the commands?

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