SuperMedIntel / Medical-SAM-Adapter

Adapting Segment Anything Model for Medical Image Segmentation
GNU General Public License v3.0
1.02k stars 90 forks source link

ValueError: high <= 0 #12

Closed nanshanvv closed 1 year ago

nanshanvv commented 1 year ago

The following error occurs when I use my own dataset for training. Can you please tell me what is causing it? image

WuJunde commented 1 year ago

your len(indices) < = 0

hhhhyyyyyyrrrrr commented 1 year ago

Hello, I encountered the same error while running my dataset. Is this the reason for my dataset?

nanshanvv commented 1 year ago

Hello, I encountered the same error while running my dataset. Is this the reason for my dataset?

Maybe, because I changed the dataset and found that the model ran successfully. But I don't really know why the previous dataset would cause this.

nanshanvv commented 1 year ago

your len(indices) < = 0

In your free time, could you tell me what usually causes this error to occur? At the moment I don't have any clues to fix this error, your advice is very valuable to me.

xiawei20161308104 commented 1 year ago

请教一下数据集路径是这样吗 ./data/isic/ISBI2016_ISIC_Part1_Test_Data/ISIC_0000169 ./data/isic/ISBI2016_ISIC_Part1_Test_GroundTruth/ISIC_0000169 ./data/isic/ISBI2016_ISIC_Part1_Training_Data/ISIC_0000169 ./data/isic/ISBI2016_ISIC_Part1_Training_GroundTruth/ISIC_0000169

The following error occurs when I use my own dataset for training. Can you please tell me what is causing it? image

nanshanvv commented 1 year ago

请教一下数据集路径是这样吗 ./data/isic/ISBI2016_ISIC_Part1_Test_Data/ISIC_0000169 ./data/isic/ISBI2016_ISIC_Part1_Test_GroundTruth/ISIC_0000169 ./data/isic/ISBI2016_ISIC_Part1_Training_Data/ISIC_0000169 ./data/isic/ISBI2016_ISIC_Part1_Training_GroundTruth/ISIC_0000169

The following error occurs when I use my own dataset for training. Can you please tell me what is causing it? image

yep

nanshanvv commented 1 year ago

The reason I found the problem seems to be because my dataset is a multi-target segmentation dataset. The source code indicates that it will transform the labeled images into 'L' for indices = np.argwhere(mask == 1). But the label image of the multi-target segmentation dataset will not be simply white after transforming it to 'L'. So I am considering how to make this model work for multi-target segmentation.

WuJunde commented 1 year ago

@nanshanvv check my BTCV example case, you need to transfer each target to a binary 2d map

nanshanvv commented 1 year ago

@nanshanvv检查我的 BTCV 示例案例,您需要将每个目标传输到二进制 2d 地图

Thank you for your reply, it was very useful for me

Issues-translate-bot commented 1 year ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Hello~ Using your own data set is not very large, 50MB,

xiawei20161308104 commented 1 year ago

您好~打扰啦。请问您的训练显存是多大呢?用的什么型号GPU呢?

Issues-translate-bot commented 1 year ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Hello~ Excuse me. How much is your training video memory? What type of GPU do you use?

nanshanvv commented 1 year ago

50A 48GB

xiawei20161308104 commented 1 year ago

50A 48GB

我这是a40 45GB 自己的数据集不大,改了bs和numberwork,几乎是瞬报显存,请问您是怎么解决的呀,方便留个邮箱吗~

Issues-translate-bot commented 1 year ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


50A 48GB

This is a40 45GB. My data set is not big. I changed the bs and numberwork, and it is almost instantaneous video memory. How did you solve it? Can you leave me an email~

nanshanvv commented 1 year ago

50A 48GB

我这是a40 45GB 自己的数据集不大,改了bs和numberwork,几乎是瞬报显存,请问您是怎么解决的呀,方便留个邮箱吗~

50A的话我把batch_size调到4是可以用的。 我邮箱1585870861@qq.com,可以交流的,没问题的

Issues-translate-bot commented 1 year ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


50A 48GB

This is a40 45GB. My data set is not big. I changed the bs and numberwork, and it is almost instantaneous video memory. How did you solve it? Can you leave an email~

If it is 50A, I can adjust the batch_size to 4 and it will work. My email is 1585870861@qq.com, I can communicate, no problem

wade0604 commented 1 year ago

@nanshanvv check my BTCV example case, you need to transfer each target to a binary 2d map

hi where is your BTCV example case?