Closed onealbao closed 2 years ago
Sorry that I didn't come across this kind of errors before. Would you please try to test your tensors/images with this offline version topoloss first? If you still have any problems, please try to post them here.
Thanks so much for the prompt feedback. I've tried the offline version of topoloss, but got the same error about 'Error in constructor Bitmap_cubical_complex_base'.
It seems that the exception is from https://github.com/HuXiaoling/TopoLoss/blob/bbf9d2699cbd76dabe113e8be810c56aa40a8e06/topoloss.py#L114
I've forked your repository and uploaded two sample images (gt.png and out.png) there for testing purposes at https://github.com/onealbao/TopoLoss. Maybe there is something wrong with my data input? Thanks a ton!
Quick update, it looks like the problem is because of my label value. The segmentation line needs to be 255 and the background is 0. The offline version works. I'll try the PyTorch version and back to post here then, thanks!
Hello, thanks so much for sharing this decent work. I'm trying to integrate the topoloss_pytorch.py into deeplab_v3 (https://github.com/chenxi116/DeepLabv3.pytorch).
The target tensor is [ 0 1 255] b/c my label only has background (0) and membrane label (1), 255 is ignored when calculating CrossEntropyLoss. The output tensor is a probability map with a value something like [-43.70812 -43.228703 -42.97284 ... 54.40196 54.60862 55.549427].
When I tried to input the target and output tensor into the topoloss, the whole pipeline crashed with the following error.
It seems that the error is from
but there is no further instruction. Have you ever seen this exception? Many thanks!