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

TypeError: 'NoneType' object is not callable help #3

Closed
Crawlling opened this issue Jul 18, 2022 · 13 comments
Closed

TypeError: 'NoneType' object is not callable help #3

Crawlling opened this issue Jul 18, 2022 · 13 comments
Labels
help wanted Extra attention is needed

Comments

@Crawlling
Copy link

22-07-18 13:32:55.933 - INFO: Begin Model Evaluation (testing).
Traceback (most recent call last):
File "D:\project\ddpm-cd-master\ddpm_cd.py", line 344, in
change_detection.test()
File "D:\project\ddpm-cd-master\model\cd_model.py", line 78, in test
self.pred_cm = self.netCD(self.feats_A, self.feats_B)
File "C:\Users\10576\AppData\Local\conda\conda\envs\ddpm\lib\site-packages\torch\nn\modules\module.py", line 1110, in _call_impl
return forward_call(*input, **kwargs)
File "D:\project\ddpm-cd-master\model\cd_modules\cd_head_v2.py", line 107, in forward
diff = torch.abs( layer(f_A) - layer(f_B) )
File "C:\Users\10576\AppData\Local\conda\conda\envs\ddpm\lib\site-packages\torch\nn\modules\module.py", line 1110, in _call_impl
return forward_call(*input, **kwargs)
File "D:\project\ddpm-cd-master\model\cd_modules\cd_head_v2.py", line 57, in forward
return self.block(x)
File "C:\Users\10576\AppData\Local\conda\conda\envs\ddpm\lib\site-packages\torch\nn\modules\module.py", line 1110, in _call_impl
return forward_call(*input, **kwargs)
File "C:\Users\10576\AppData\Local\conda\conda\envs\ddpm\lib\site-packages\torch\nn\modules\container.py", line 141, in forward
input = module(input)
TypeError: 'NoneType' object is not callable

@Crawlling
Copy link
Author

help please

@Crawlling
Copy link
Author

All the pretrained CD head models i can not use..but i can use the diffusion model.

@wgcban
Copy link
Owner

wgcban commented Jul 18, 2022

Are you using the correct pre-trained CD model? There are different configurations (t).

@Crawlling
Copy link
Author

Crawlling commented Jul 18, 2022

Are you using the correct pre-trained CD model? There are different configurations (t).

thx for reply!i've check the pre-trained CD model and config,it is correct,i don't know why this alway happen,i've already try it on 2 PC.
but i try to use pre-trained Diffusion model to train CD head model,in epoch 0,it still got pretty nice F1 and iou.thank you.

@wgcban
Copy link
Owner

wgcban commented Jul 18, 2022

I see. I will look into this problem. The thing is, it is working fine with my machine. I am happy that at least you managed to fine-tune it and got reasonable iou. I will look into this problem and update you if I find the reason. In case if you find the reason, pls post it here so that it will benefit others. Thank you.

@wgcban wgcban added help wanted Extra attention is needed bug Something isn't working labels Jul 18, 2022
@Crawlling
Copy link
Author

Crawlling commented Jul 18, 2022

I see. I will look into this problem. The thing is, it is working fine with my machine. I am happy that at least you managed to fine-tune it and got reasonable iou. I will look into this problem and update you if I find the reason. In case if you find the reason, pls post it here so that it will benefit others. Thank you.

thank you for your patience,i will.

@wgcban
Copy link
Owner

wgcban commented Jul 18, 2022

@Crawlling Did you specify the correct time steps (t) here corresponding to the fine-tuned model you use in the test config:

"t": [50, 100, 400, 650]

@Crawlling
Copy link
Author

specify

OMG,i forgot this,my bad, sorry for wasting your time.thank you again!

@wgcban
Copy link
Owner

wgcban commented Jul 18, 2022

@Crawlling np.

@wgcban wgcban removed the bug Something isn't working label Jul 18, 2022
@wgcban wgcban pinned this issue Jul 18, 2022
@sitongzhen
Copy link

How much memory does this method take? Is 24GB not enough by default?

@wgcban
Copy link
Owner

wgcban commented Oct 5, 2022

Hi @sitongzhen
Do you mean pre-training or fine-tuning?
I used one 48GB GPU for my experiments, and I believe a 24GB GPU should be fine. You just need to reduce the batch size in the config file. However, you can significantly save time by initializing your model with the pre-trained models provided here, as that will make the training faster even on new datasets.

Feel free to reach out to me know if you have more questions.

Also, the code works on multiple GPUs as well.

@sitongzhen
Copy link

Yes, I understand. Thanks for your answer. When the batch is 8, I find the 24 G memory is insufficient in the training process.

@wgcban
Copy link
Owner

wgcban commented Oct 5, 2022

@sitongzhen I don't expect results to vary significantly, and it is fine given the memory constraint.
I see, make it down to 4 and see the results.
Good luck!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants