UNeXt-pytorch icon indicating copy to clipboard operation
UNeXt-pytorch copied to clipboard

NoneType' object is not subscriptable

Open Eveinn opened this issue 2 years ago • 14 comments

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]

Eveinn avatar Apr 24 '22 06:04 Eveinn

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?

jeya-maria-jose avatar Apr 27 '22 17:04 jeya-maria-jose

Did you solve this problem please?

Sept30 avatar May 10 '22 14:05 Sept30

--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)

Eveinn avatar May 12 '22 07:05 Eveinn

Have you solved this problem?

huying12 avatar May 16 '22 02:05 huying12

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

Chikeee avatar May 16 '22 12:05 Chikeee

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

they are same

Eveinn avatar May 16 '22 12:05 Eveinn

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

Chikeee avatar May 16 '22 12:05 Chikeee

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 avatar May 17 '22 01:05 huying12

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: @.***>

huying12 avatar May 17 '22 01:05 huying12

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

[email protected]!

I have sent the code to your email.

Chikeee avatar May 17 '22 11:05 Chikeee

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

[email protected]!

I have sent the code to your email.

could you please send me the code too, thanks! email: [email protected]

Azhihong avatar May 20 '22 14:05 Azhihong

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

[email protected]!

I have sent the code to your email.

zkzk123zk avatar Jun 29 '22 10:06 zkzk123zk

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 avatar Aug 10 '22 13:08 CJD1203

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

[email protected]!

I have sent the code to your email.

hi,could you please send me the code too, thanks! my email: [email protected]

CJD1203 avatar Aug 10 '22 13:08 CJD1203

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

heixinbaicaishang avatar Sep 05 '22 15:09 heixinbaicaishang

Can you send me the code to my email? Thanks [email protected]

Sweetnehi avatar Sep 08 '22 12:09 Sweetnehi

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

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

could you please send me the code too, thanks! email: [email protected]

Zzs0720 avatar Sep 13 '22 12:09 Zzs0720

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: @.***>

huying12 avatar Oct 11 '22 09:10 huying12

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

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

could you please send me the code too, thanks! email: [email protected]

could you please send me the code too, thanks! email: [email protected]

SE-Nickjackson avatar Jun 29 '23 13:06 SE-Nickjackson

could you please send me the code too, thanks! email: [email protected]

could you please send me the code too, thanks! email: [email protected]

SE-Nickjackson avatar Jun 29 '23 13:06 SE-Nickjackson

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

[email protected]!

I have sent the code to your email.

could you please send me the code too. my email: [email protected] . thanks!

RacusNguyen avatar Sep 12 '23 09:09 RacusNguyen

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

[email protected]!

I have sent the code to your email.

Hi, I still have the same problem. Could you send me a copy? [email protected], thanks!

Myrrolinz avatar Feb 11 '24 11:02 Myrrolinz