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

Train on New Dataset #42

Open
LokeSiewWen opened this issue Mar 30, 2024 · 4 comments
Open

Train on New Dataset #42

LokeSiewWen opened this issue Mar 30, 2024 · 4 comments

Comments

@LokeSiewWen
Copy link

Hi, may I know how to train on new Dataset? I am facing this error when trying to input the new dataset.

Traceback (most recent call last):
File "/content/CounTR/FSC_finetune_cross.py", line 456, in
main(args)
File "/content/CounTR/FSC_finetune_cross.py", line 287, in main
output = model(samples, boxes, shot_num)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1520, in _call_impl
return forward_call(*args, **kwargs)
File "/content/CounTR/models_mae_cross.py", line 206, in forward
pred = self.forward_decoder(latent, boxes, shot_num) # [N, 384, 384]
File "/content/CounTR/models_mae_cross.py", line 174, in forward_decoder
y = torch.cat(y1,dim=0).reshape(shot_num,N,C).to(x.device)
RuntimeError: shape '[2, 1, 512]' is invalid for input of size 512
Traceback (most recent call last):
File "/content/CounTR/FSC_finetune_cross.py", line 456, in
main(args)
File "/content/CounTR/FSC_finetune_cross.py", line 287, in main
output = model(samples, boxes, shot_num)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1520, in _call_impl
return forward_call(*args, **kwargs)
File "/content/CounTR/models_mae_cross.py", line 206, in forward
pred = self.forward_decoder(latent, boxes, shot_num) # [N, 384, 384]
File "/content/CounTR/models_mae_cross.py", line 174, in forward_decoder
y = torch.cat(y1,dim=0).reshape(shot_num,N,C).to(x.device)
RuntimeError: shape '[2, 1, 512]' is invalid for input of size 512
[08:42:33.922301] [08:42:33.922375] [08:42:33.922399] [08:42:33.922411] [08:42:33.922425] [08:42:33.922438] [08:42:33.922451] [08:42:33.922477]

Thanks for your help in advance!

@Verg-Avesta
Copy link
Owner

This seems to be a shape mismatch problem. So if you can ensure that the form and size of the new input dataset are the same as FSC147, there should be no problem.

@LokeSiewWen
Copy link
Author

LokeSiewWen commented Apr 15, 2024

Hi, Thanks! Is working now. But I do have a few questions and would like some clarifications from you.

  1. Do we need to manually generate the density map?
  2. Are they necessary during training?

image

Thanks for your help in advance! :)

@Verg-Avesta
Copy link
Owner

Yes, I believe it is essential to manually generate density maps, as Gaussian density maps could lead to smaller errors compared to dot annotations.

@famersalltheday
Copy link

Hi, Thanks! Is working now. But I do have a few questions and would like some clarifications from you.

  1. Do we need to manually generate the density map?
  2. Are they necessary during training?

image

Thanks for your help in advance! :)

Hi, I was wondering about the process for training new data sets. Is a new dataset file created, or is it a supplement to the original FSC147 file? Because I found out that the annotation.json in FSC147 is read-only, I can't edit it.

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

3 participants