ada-shen / ICNN

A pytorch implementation of interpretable convolutional neural network.
MIT License
63 stars 20 forks source link

AttributeError: 'NoneType' object has no attribute 'shape' #9

Open xiumia opened 2 years ago

xiumia commented 2 years ago

File "demo.py", line 55, in classification(root_path, args) File "/root/CV/ICNN-main/tools/classification.py", line 27, in classification train_dataloader, var_dataloader, density, dataset_length = load_data(root_path, task_model_dataset_labelname_path, args) File "/root/CV/ICNN-main/tools/load_data.py", line 119, in load_data imdb_train, imdb_val = get_imdb(root_path,imdb_path,datasets_path,args.dataset,args.imagesize,args.label_name) File "/root/CV/ICNN-main/tools/load_data.py", line 88, in get_imdb imdb_train, imdb_val, imdb_mean = get_voc2010imdb(root_path, dataset, dataset_path, label_name, imagesize) File "/root/CV/ICNN-main/tools/get_voc2010imdb.py", line 62, in get_voc2010imdb I = getI(objset_train_true[i],(image_size,image_size), IsFlip) File "/root/CV/ICNN-main/tools/get_voc2010imdb.py", line 13, in getI if(len(I.shape)==2): AttributeError: 'NoneType' object has no attribute 'shape'

你好,我想问一下,这个问题怎么解决呢?

ada-shen commented 2 years ago

你好, 这个报错可能原因是没有获取到图像,你可以检查一下数据集路径,或者读取数据的问题。

2022年4月6日 09:13,GuanHua WU @.***> 写道:

File "demo.py", line 55, in classification(root_path, args) File "/root/CV/ICNN-main/tools/classification.py", line 27, in classification train_dataloader, var_dataloader, density, dataset_length = load_data(root_path, task_model_dataset_labelname_path, args) File "/root/CV/ICNN-main/tools/load_data.py", line 119, in load_data imdb_train, imdb_val = get_imdb(root_path,imdb_path,datasets_path,args.dataset,args.imagesize,args.label_name) File "/root/CV/ICNN-main/tools/load_data.py", line 88, in get_imdb imdb_train, imdb_val, imdb_mean = get_voc2010imdb(root_path, dataset, dataset_path, label_name, imagesize) File "/root/CV/ICNN-main/tools/get_voc2010imdb.py", line 62, in get_voc2010imdb I = getI(objset_train_true[i],(image_size,image_size), IsFlip) File "/root/CV/ICNN-main/tools/get_voc2010imdb.py", line 13, in getI if(len(I.shape)==2): AttributeError: 'NoneType' object has no attribute 'shape'

你好,我想问一下,这个问题怎么解决呢?

— Reply to this email directly, view it on GitHub https://github.com/ada-shen/ICNN/issues/9, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOY3CBMS3XWKIEUKX5JIVJDVDTQKBANCNFSM5SUOEW2Q. You are receiving this because you are subscribed to this thread.

xiumia commented 2 years ago

但是load_data.py并没有执行,不能下载数据集;downloadpath2_vocpart = "http://host.robots.ox.ac.uk/pascal/VOC/voc2010/VOCtrainval_03-May-2010.tar" 比如说这个链接,好像没能用到

ada-shen commented 2 years ago

是不是调错函数了呢?要不提供下你的指令吧

2022年4月7日 19:20,GuanHua WU @.***> 写道:

但是load_data.py并没有执行,不能下载数据集;downloadpath2_vocpart = "http://host.robots.ox.ac.uk/pascal/VOC/voc2010/VOCtrainval_03-May-2010.tar http://host.robots.ox.ac.uk/pascal/VOC/voc2010/VOCtrainval_03-May-2010.tar" 比如说这个链接,好像没能用到

— Reply to this email directly, view it on GitHub https://github.com/ada-shen/ICNN/issues/9#issuecomment-1091613327, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOY3CBLGAXYOT7WB45PFQGTVD3AIJANCNFSM5SUOEW2Q. You are receiving this because you commented.

xiumia commented 2 years ago

python demo.py --model resnet_18 --dataset voc2010_crop --label_name bird

18434753275

@. | 签名由网易邮箱大师定制 On 4/7/2022 @.> wrote:

是不是调错函数了呢?要不提供下你的指令吧

2022年4月7日 19:20,GuanHua WU @.***> 写道:

但是load_data.py并没有执行,不能下载数据集;downloadpath2_vocpart = "http://host.robots.ox.ac.uk/pascal/VOC/voc2010/VOCtrainval_03-May-2010.tar http://host.robots.ox.ac.uk/pascal/VOC/voc2010/VOCtrainval_03-May-2010.tar" 比如说这个链接,好像没能用到

— Reply to this email directly, view it on GitHub https://github.com/ada-shen/ICNN/issues/9#issuecomment-1091613327, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOY3CBLGAXYOT7WB45PFQGTVD3AIJANCNFSM5SUOEW2Q. You are receiving this because you commented.

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

xiumia commented 2 years ago

这个是不是要自己另外下载数据集放到文件夹中

xiumia commented 2 years ago

你好,请问我能加一下你的联系方式吗,方便沟通

18434753275

@.*** |

签名由 网易邮箱大师 定制

On 04/07/2022 19:38, 18434753275 wrote: python demo.py --model resnet_18 --dataset voc2010_crop --label_name bird

18434753275

@. | 签名由网易邮箱大师定制 On 4/7/2022 @.> wrote:

是不是调错函数了呢?要不提供下你的指令吧

2022年4月7日 19:20,GuanHua WU @.***> 写道:

但是load_data.py并没有执行,不能下载数据集;downloadpath2_vocpart = "http://host.robots.ox.ac.uk/pascal/VOC/voc2010/VOCtrainval_03-May-2010.tar http://host.robots.ox.ac.uk/pascal/VOC/voc2010/VOCtrainval_03-May-2010.tar" 比如说这个链接,好像没能用到

— Reply to this email directly, view it on GitHub https://github.com/ada-shen/ICNN/issues/9#issuecomment-1091613327, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOY3CBLGAXYOT7WB45PFQGTVD3AIJANCNFSM5SUOEW2Q. You are receiving this because you commented.

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