ChenLiu-1996 / CUTS

[MICCAI 2024] CUTS: A Deep Learning and Topological Framework for Multigranular Unsupervised Medical Image Segmentation
https://arxiv.org/abs/2209.11359
Other
32 stars 2 forks source link

issue #12

Closed wwzz-max closed 8 months ago

wwzz-max commented 10 months ago

Traceback (most recent call last): File "/public/home/accran5j3j/UnsupervisedMedicalSeg_1/src/scripts_analysis/generate_diffusion.py", line 82, in labels_pred, granularities = generate_diffusion( File "/public/home/accran5j3j/UnsupervisedMedicalSeg_1/src/scripts_analysis/generate_diffusion.py", line 30, in generate_diffusion labels_pred, granularities = diffusion_condensation( File "/public/home/accran5j3j/UnsupervisedMedicalSeg_1/src/scripts_analysis/../utils/diffusion_condensation.py", line 42, in diffusion_condensation levels = catch_op.transform() File "/public/home/accran5j3j/.local/lib/python3.9/site-packages/CATCH/catch.py", line 80, in transform for c in range(len(self.NxTs)): TypeError: object of type 'NoneType' has no len()

ChenLiu-1996 commented 10 months ago

Thank you for your issue.

However, from now on I will not be able to respond to issues like this one.

You only provided the error message, without any description on what you were trying to do, how you organized the folders, what you were/weren't able to run previously, etc. It will be difficult for us to locate the problem and to further assist you.

Besides, in this case it seems that self.NxTs is None, which you can try to see why that is the case.

wwzz-max commented 10 months ago

您好,我是在执行以下操作的时候出现的这个问题,以前没出现过,就是最近克隆下来的代码出现了下面的问题。 cd cuts/src/scripts_analysis (python3.9) [root@b9f16f79400c scripts_analysis]# python generate_diffusion.py --config ../../config/retina_seed2022.yaml 0%| | 0/56 [00:00<?, ?it/s]Calculating PCA... Calculated PCA in 1.40 seconds. Calculating Diffusion Condensation... Calculated Diffusion Condensation in 14.62 seconds. Calculating PCA... Calculated PCA in 0.70 seconds. Calculating Diffusion Condensation... Calculated Diffusion Condensation in 15.56 seconds. Calculating PCA... Calculated PCA in 0.22 seconds. Calculating Diffusion Condensation... Calculated Diffusion Condensation in 12.46 seconds. Calculating PCA... Calculated PCA in 0.49 seconds. Calculating Diffusion Condensation... Calculated Diffusion Condensation in 12.37 seconds. Calculating PCA... Calculated PCA in 0.45 seconds. Calculating Diffusion Condensation... Calculated Diffusion Condensation in 13.19 seconds. Calculating Topological Activity... 0%| | 0/56 [01:11<?, ?it/s] Traceback (most recent call last): File "/public/home/accran5j3j/cuts/src/scripts_analysis/generate_diffusion.py", line 82, in labels_pred, granularities = generate_diffusion( File "/public/home/accran5j3j/cuts/src/scripts_analysis/generate_diffusion.py", line 30, in generate_diffusion labels_pred, granularities = diffusion_condensation( File "/public/home/accran5j3j/cuts/src/scripts_analysis/../utils/diffusion_condensation.py", line 42, in diffusion_condensation levels = catch_op.transform() File "/public/home/accran5j3j/.local/lib/python3.9/site-packages/CATCH/catch.py", line 80, in transform for c in range(len(self.NxTs)): TypeError: object of type 'NoneType' has no len() (python3.9) [root@b9f16f79400c scripts_analysis]#

ChenLiu-1996 commented 10 months ago

That's interesting. I just tried to run it again, and it seems to be working for me.

python generate_diffusion.py --config ../../config/retina_seed2022.yaml -o 
  0%|                                                                              | 0/56 [00:00<?, ?it/s]Calculating PCA...
Calculated PCA in 0.40 seconds.
Calculating Diffusion Condensation...
  Calculating Condensation Parameters...
  Calculated Condensation Parameters in 11.20 seconds.
Calculated Diffusion Condensation in 158.85 seconds.
Calculating Topological Activity...
Calculated Topological Activity in 0.02 seconds.
  2%|█▏                                                                 | 1/56 [02:39<2:26:14, 159.54s/it]

The error message you sent TypeError: object of type 'NoneType' has no len() tells you the reason. It's saying self.NxTs is None. I suspect that the feature maps you generated (the input latent to the diffusion condensation) is highly homogeneous --- meaning that all pixels are highly similar. The diffusion condensation code is handled by a package called CATCH, and I don't have access to its implementation. If that does not handle the edge cases well, I can only try to work things around but cannot really do too much about it.

vitalii-slobodzian commented 9 months ago

Hi @wwzz-max! I am getting the same error as you. Did you manage to figure it out?

I am using retina dataset and retina_seed2022.yaml config without any changes.

ChenLiu-1996 commented 8 months ago

BTW I updated the code for and now I am using MultiscalePHATE for diffusion condensation. Maybe you can try again.

vitalii-slobodzian commented 8 months ago

@ChenLiu-1996 thanks you a lot, now it works well!