Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

While multiclass, ValueError: cannot reshape array of size 10 into shape (2,2)@wangqingl If you have 10 classes you need to write separate visualizer to visualize all the classes. Since, you removed pred * 255 your values the output.png will be between 0 and 9 - hence you see dark (or black) output. You need to write the visualizer such that it will assign different color values for each predicted output class. #93

Closed
StorywithLove opened this issue Jan 31, 2024 · 3 comments
Labels
documentation Improvements or additions to documentation

Comments

@StorywithLove
Copy link

When I made modifications according to the above method, the following error occurred during training. How to solve it? @wangqingl If you have 10 classes you need to write separate visualizer to visualize all the classes. Since, you removed pred * 255 your values the output.png will be between 0 and 9 - hence you see dark (or black) output. You need to write the visualizer such that it will assign different color values for each predicted output class.

Originally posted by @wgcban in #88 (comment)

@StorywithLove
Copy link
Author

So far it's been found that it's due to hyperparameters not being passed into the function correctly, and the solution is as follows:

image

@StorywithLove
Copy link
Author

StorywithLove commented Jan 31, 2024

Summary of the changes needed to modify binary change detection to multi-class change detection:

(1) run_ChangeFormer_cj.sh
n_class=8 and make it a hyperparameter to python main.py

(2) models/networks.py
net = ChangeFormerV6(embed_dim=args.embed_dim, output_nc=args.n_class)

(3) models/basic_model.py
Comment out: pred_vis = pred * 255, i.e., modifications to visualisation processing

(4) models/trainer.py
Modify: ConfuseMatrixMeter(n_class=self.n_class)

@wgcban
Copy link
Owner

wgcban commented Jan 31, 2024

@Programming-Music Thank you for summarizing all these steps! It will be really helpful for those who wish to use ChangeFormer for multi-class change detection.

@wgcban wgcban added the documentation Improvements or additions to documentation label Jan 31, 2024
Repository owner locked and limited conversation to collaborators Jan 31, 2024
@wgcban wgcban converted this issue into discussion #94 Jan 31, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants