jeya-maria-jose / UNeXt-pytorch

Official Pytorch Code base for "UNeXt: MLP-based Rapid Medical Image Segmentation Network", MICCAI 2022
https://jeya-maria-jose.github.io/UNext-web/
MIT License
459 stars 76 forks source link

NoneType' object is not subscriptable #13

Closed Eveinn closed 1 year ago

Eveinn commented 2 years ago

how do i solve this problem 图片 Traceback (most recent call last): File "D:/Code/UNeXt/train.py", line 371, in <module> main() File "D:/Code/UNeXt/train.py", line 326, in main train_log = train(config, train_loader, model, criterion, optimizer) File "D:/Code/UNeXt/train.py", line 119, in train for input, target, _ in train_loader: File "C:\ProgramData\Anaconda3\lib\site-packages\torch\utils\data\dataloader.py", line 521, in __next__ data = self._next_data() File "C:\ProgramData\Anaconda3\lib\site-packages\torch\utils\data\dataloader.py", line 561, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "C:\ProgramData\Anaconda3\lib\site-packages\torch\utils\data\_utils\fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "C:\ProgramData\Anaconda3\lib\site-packages\torch\utils\data\_utils\fetch.py", line 44, in <listcomp> data = [self.dataset[idx] for idx in possibly_batched_index] File "D:\Code\UNeXt\dataset.py", line 63, in __getitem__ img_id + self.mask_ext), cv2.IMREAD_GRAYSCALE)[..., None]) TypeError: 'NoneType' object is not subscriptable 0%| | 0/21 [00:00<?, ?it/s]

jeya-maria-jose commented 2 years ago

I believe this has something to do with the input type (3 channel or 1 channel) option. Can you please post the command line you used in terminal?

Sept30 commented 2 years ago

Did you solve this problem please?

Eveinn commented 2 years ago

--name UNEXT-BUSI --dataset BUSI --img_ext .png --mask_ext .png --lr 0.0001 --epochs 500 --input_w 256 --input_h 256 --b 8 --epochs 1000 --input_channels 1

BTW,I have changed the number of input_channels(both 1 channel and 3 channels had done,and failed)

huying12 commented 2 years ago

Have you solved this problem?

Chikeee commented 2 years ago

The file names of the images and labels must be the same.

Eveinn commented 2 years ago

The file names of the images and labels must be the same.

they are same

Chikeee commented 2 years ago

The file names of the images and labels must be the same.

they are same You can give me the email and I'll send you my code

huying12 commented 2 years ago

I have changed the image and mask name to be consistent, but it still appears TypeError: Caught TypeError in DataLoader worker process 0 and TypeError: 'NoneType' object is not subscriptable.Can you help me solve this problem? Thank you very much.

------------------ 原始邮件 ------------------ 发件人: "jeya-maria-jose/UNeXt-pytorch" @.>; 发送时间: 2022年5月16日(星期一) 晚上8:55 @.>; @.**@.>; 主题: Re: [jeya-maria-jose/UNeXt-pytorch] NoneType' object is not subscriptable (Issue #13)

The file names of the images and labels must be the same.

they are same You can give me the email and I'll send you my code

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

huying12 commented 2 years ago

I have changed the image and mask name to be consistent, but it still appears TypeError: Caught TypeError in DataLoader worker process 0 and TypeError: 'NoneType' object is not subscriptable.Can you help me solve this problem? Thank you very much.

------------------ 原始邮件 ------------------ 发件人: "jeya-maria-jose/UNeXt-pytorch" @.>; 发送时间: 2022年5月16日(星期一) 晚上8:42 @.>; @.**@.>; 主题: Re: [jeya-maria-jose/UNeXt-pytorch] NoneType' object is not subscriptable (Issue #13)

The file names of the images and labels must be the same.

they are same

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

Chikeee commented 2 years ago

The file names of the images and labels must be the same.

they are same You can give me the email and I'll send you my code

yinwen325@163.com.Thanks!

I have sent the code to your email.

Azhihong commented 2 years ago

I have changed the number of input_channels(both 1 channel and 3 channels had done,and failed)

The file names of the images and labels must be the same.

they are same You can give me the email and I'll send you my code

yinwen325@163.com.Thanks!

I have sent the code to your email.

could you please send me the code too, thanks! email: harris19944@outlook.com

zkzk123zk commented 2 years ago

The file names of the images and labels must be the same.

they are same You can give me the email and I'll send you my code

yinwen325@163.com.Thanks!

I have sent the code to your email.

CJD1203 commented 2 years ago

I have changed the image and mask name to be consistent, but it still appears TypeError: Caught TypeError in DataLoader worker process 0 and TypeError: 'NoneType' object is not subscriptable.Can you help me solve this problem? Thank you very much. ------------------ 原始邮件 ------------------ 发件人: "jeya-maria-jose/UNeXt-pytorch" @.>; 发送时间: 2022年5月16日(星期一) 晚上8:42 @.>; @.**@.>; 主题: Re: [jeya-maria-jose/UNeXt-pytorch] NoneType' object is not subscriptable (Issue #13) The file names of the images and labels must be the same. they are same — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

I have changed the image and mask name to be consistent, but it still appears TypeError: Caught TypeError in DataLoader worker process 0 and TypeError: 'NoneType' object is not subscriptable.Can you help me solve this problem? Thank you very much. ------------------ 原始邮件 ------------------ 发件人: "jeya-maria-jose/UNeXt-pytorch" @.>; 发送时间: 2022年5月16日(星期一) 晚上8:42 @.>; @.**@.>; 主题: Re: [jeya-maria-jose/UNeXt-pytorch] NoneType' object is not subscriptable (Issue #13) The file names of the images and labels must be the same. they are same — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

Hello, I have encountered this problem too. Have you solved it?

I have changed the image and mask name to be consistent, but it still appears TypeError: Caught TypeError in DataLoader worker process 0 and TypeError: 'NoneType' object is not subscriptable.Can you help me solve this problem? Thank you very much. ------------------ 原始邮件 ------------------ 发件人: "jeya-maria-jose/UNeXt-pytorch" @.>; 发送时间: 2022年5月16日(星期一) 晚上8:42 @.>; @.**@.>; 主题: Re: [jeya-maria-jose/UNeXt-pytorch] NoneType' object is not subscriptable (Issue #13) The file names of the images and labels must be the same. they are same — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

Hello, I have encountered this problem too. Have you solved it?

CJD1203 commented 2 years ago

The file names of the images and labels must be the same.

they are same You can give me the email and I'll send you my code

yinwen325@163.com.Thanks!

I have sent the code to your email.

hi,could you please send me the code too, thanks! my email: welcomcjd@163.com

heixinbaicaishang commented 2 years ago

I think it was because the classes were set incorrectly, I changed it to 1 and it ran. image

Sweetnehi commented 1 year ago

Can you send me the code to my email? Thanks 2576749829@qq.com

Zzs0720 commented 1 year ago

图像和标签的文件名必须相同。

他们是一样的你可以给我电子邮件,我会给你我的代码

could you please send me the code too, thanks! email: 1097575240@qq.com

huying12 commented 1 year ago

I have changed the image and mask name to be consistent, but it still appears TypeError: Caught TypeError in DataLoader worker process 0 and TypeError: 'NoneType' object is not subscriptable.Can you help me solve this problem? Thank you very much. ------------------ 原始邮件 ------------------ 发件人: "jeya-maria-jose/UNeXt-pytorch" @.>; 发送时间: 2022年5月16日(星期一) 晚上8:27 @.>; @.**@.>; 主题: Re: [jeya-maria-jose/UNeXt-pytorch] NoneType' object is not subscriptable (Issue #13)

The file names of the images and labels must be the same.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

SE-Nickjackson commented 1 year ago

图像和标签的文件名必须相同。

他们是一样的你可以给我电子邮件,我会给你我的代码

could you please send me the code too, thanks! email: 1097575240@qq.com

could you please send me the code too, thanks! email: caifls@163.com

SE-Nickjackson commented 1 year ago

could you please send me the code too, thanks! email: caifls@163.com

could you please send me the code too, thanks! email: caifls@163.com

RacusNguyen commented 12 months ago

The file names of the images and labels must be the same.

they are same You can give me the email and I'll send you my code

yinwen325@163.com.Thanks!

I have sent the code to your email.

could you please send me the code too. my email: ducnt.hust.edu@gmail.com . thanks!

Myrrolinz commented 6 months ago

The file names of the images and labels must be the same.

they are same You can give me the email and I'll send you my code

yinwen325@163.com.Thanks!

I have sent the code to your email.

Hi, I still have the same problem. Could you send me a copy? 1195564913@qq.com, thanks!