lehaifeng / DASNet

135 stars 41 forks source link

Do u have data about this code?Thank you! #4

Open louxiantuo opened 4 years ago

louxiantuo commented 4 years ago

I have ChangeDetectionDataset ,but I don‘t have train.txt . I don't know how to write.

lehaifeng commented 4 years ago

You need to generate it yourself and its organization is in the readme

louxiantuo commented 4 years ago

根据您给的对于在readme上给的结构,我自己生成了,类似以下的txt: D:/xunleiDownload/DASNet-master/DASNET/dataset/ChangeDetectionDataset/Model/with_shift/train/A/00000.jpg D:/xunleiDownload/DASNet-master/DASNET/dataset/ChangeDetectionDataset/Model/with_shift/train/B/00000.jpg D:/xunleiDownload/DASNet-master/DASNET/dataset/ChangeDetectionDataset/Model/with_shift/train/OUT/00000.jpg D:/xunleiDownload/DASNet-master/DASNET/dataset/ChangeDetectionDataset/Model/with_shift/train/A/00001.jpg D:/xunleiDownload/DASNet-master/DASNET/dataset/ChangeDetectionDataset/Model/with_shift/train/B/00001.jpg D:/xunleiDownload/DASNet-master/DASNET/dataset/ChangeDetectionDataset/Model/with_shift/train/OUT/00001.jpg D:/xunleiDownload/DASNet-master/DASNET/dataset/ChangeDetectionDataset/Model/with_shift/train/A/00002.jpg D:/xunleiDownload/DASNet-master/DASNET/dataset/ChangeDetectionDataset/Model/with_shift/train/B/00002.jpg D:/xunleiDownload/DASNet-master/DASNET/dataset/ChangeDetectionDataset/Model/with_shift/train/OUT/00002.jpg D:/xunleiDownload/DASNet-master/DASNET/dataset/ChangeDetectionDataset/Model/with_shift/train/A/00003.jpg D:/xunleiDownload/DASNet-master/DASNET/dataset/ChangeDetectionDataset/Model/with_shift/train/B/00003.jpg D:/xunleiDownload/DASNet-master/DASNET/dataset/ChangeDetectionDataset/Model/with_shift/train/OUT/00003.jpg D:/xunleiDownload/DASNet-master/DASNET/dataset/ChangeDetectionDataset/Model/with_shift/train/A/00004.jpg D:/xunleiDownload/DASNet-master/DASNET/dataset/ChangeDetectionDataset/Model/with_shift/train/B/00004.jpg D:/xunleiDownload/DASNet-master/DASNET/dataset/ChangeDetectionDataset/Model/with_shift/train/OUT/00004.jpg ... 但是,这种情况下image_name似乎没法得到,是我生成的train.txt文件的格式有问题吗? Traceback (most recent call last): File "D:/xunleiDownload/DASNet-master/DASNET/train.py", line 225, in main() File "D:/xunleiDownload/DASNet-master/DASNET/train.py", line 143, in main transform_med = train_transform_det) File "D:\xunleiDownload\DASNet-master\DASNET\dataset\CDD.py", line 92, in init self.img_label_path_pairs = self.get_img_label_path_pairs() File "D:\xunleiDownload\DASNet-master\DASNET\dataset\CDD.py", line 103, in get_img_label_path_pairs extract_name = image1_name[image1_name.rindex('/') +1: image1_name.rindex('.')]\ UnboundLocalError: local variable 'image1_name' referenced before assignment

lehaifeng commented 4 years ago

首先请仔细阅读cfg/CDD.py。你需要自己生成TXT文件不必包含绝对路径,其A,B,OUT文件夹中的对应文件需要并列在同一行并以空格隔开,例如 A/01,jpg B/01.jpg OUT/01.jpg 另外需要注意pytorch版本。

ClarissaDHL commented 4 years ago

I encountered the same problem, I do not know how to generate train.txt, can you explain it more specifically, thank you.

louxiantuo commented 4 years ago

OK,give me your e-mail,and I will send u my train.txt file,then u can refer it.

ClarissaDHL commented 4 years ago

dudubit@126.com Thank you so much.

louxiantuo commented 4 years ago

dudubit@126.com Thank you so much.

Ok,I already sent ur e-mail.about val.txt,train.txt and grenratetxt.py. And your should change ur path.

raminrahimi6970 commented 4 years ago

raminram6970@gmail.com would you mind sent to me email about val.txt,train.txt and grenratetxt.py thanks

ClarissaDHL commented 4 years ago

------------------ 原始邮件 ------------------ 发件人: "raminrahimi6970"<notifications@github.com>; 发送时间: 2020年5月13日(星期三) 下午5:03 收件人: "lehaifeng/DASNet"<DASNet@noreply.github.com>; 抄送: "185221369"<185221369@qq.com>;"Comment"<comment@noreply.github.com>; 主题: Re: [lehaifeng/DASNet] Do u have data about this code?Thank you! (#4)

raminram6970@gmail.com would you mind sent to me email about val.txt,train.txt and grenratetxt.py thanks

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

louxiantuo commented 4 years ago

raminram6970@gmail.com would you mind sent to me email about val.txt,train.txt and grenratetxt.py thanks

Ok,I already sent ur e-mail.about val.txt,train.txt and grenratetxt.py. And your should change ur path.

raminrahimi6970 commented 4 years ago

thanks but i do not received file

On Wed, May 13, 2020 at 2:42 PM louxiantuo notifications@github.com wrote:

raminram6970@gmail.com would you mind sent to me email about val.txt,train.txt and grenratetxt.py thanks

Ok,I already sent ur e-mail.about val.txt,train.txt and grenratetxt.py. And your should change ur path.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/lehaifeng/DASNet/issues/4#issuecomment-627888248, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHB4G6XBNAOMDCMJ5PPL4FLRRJXBRANCNFSM4MQAOV5Q .

lehaifeng commented 4 years ago

HI, louxiantuo, thanks for your kindly help. I hope you enjoy it and have better research.

louxiantuo commented 4 years ago

thanks but i do not received file On Wed, May 13, 2020 at 2:42 PM louxiantuo @.> wrote: @. would you mind sent to me email about val.txt,train.txt and grenratetxt.py thanks Ok,I already sent ur e-mail.about val.txt,train.txt and grenratetxt.py. And your should change ur path. — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#4 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHB4G6XBNAOMDCMJ5PPL4FLRRJXBRANCNFSM4MQAOV5Q .

I send it again,please check it.

TingquanGao commented 4 years ago

Could you release the train.txt, val.txt and grenratetxt.py on GitHub or Google Driver or others? I think many people want to refer it. Thank you!

louxiantuo commented 4 years ago

OK,I will upload in my github,and I will send a link in here.

louxiantuo commented 4 years ago

https://github.com/louxiantuo/DASnet-train.txt-val.txt- @TingquanGao

raminrahimi6970 commented 4 years ago

Hi Thanks a lot for your help I want to test some image with Pretrained model for CCD but have error like this: Missing key(s) in state_dict: "CNN.fc6_1.0.weight", "CNN.fc6_1.0.bias", "CNN.fc7_1.0.weight", "CNN.fc7_1.0.bias" perhaps some wight of this file " CDD_model_best.pth" that you are upload in google drive are miss. can you help me? thanks a lot

TingquanGao commented 4 years ago

Hi Thanks a lot for your help I want to test some image with Pretrained model for CCD but have error like this: Missing key(s) in state_dict: "CNN.fc6_1.0.weight", "CNN.fc6_1.0.bias", "CNN.fc7_1.0.weight", "CNN.fc7_1.0.bias" perhaps some wight of this file " CDD_model_best.pth" that you are upload in google drive are miss. can you help me? thanks a lot

I think that in the test part, there is no need to reversely calculate the gradient, so the parameters of fc layers do not need to be saved in the model file.Thus when the model file is loaded, you could try to set strick = False. My code is as follows:

model = models.SiameseNet(norm_flag='l2')
state_dict = torch.load('../pretrain/CDD_model_best.pth')['state_dict']
net = model.load_state_dict(state_dict, strict = False)
raminrahimi6970 commented 4 years ago

thanks a lot for your help after this I have to design my fc and then use model? or i can use: out_conv5, out_fc, out_embedding = net(img1, img2) for predict?

TingquanGao commented 4 years ago

thanks a lot for your help after this I have to design my fc and then use model? or i can use: out_conv5, out_fc, out_embedding = net(img1, img2) for predict?

After this, you can use validate() to predict, but you may need to modify validate().

raminrahimi6970 commented 4 years ago

yes sure I try your solution but have error when eval() the model it need fc layer. i think we have to had fc wight for validate and test. thanks for your answer are you test your solution?

TingquanGao commented 4 years ago

yes sure I try your solution but have error when eval() the model it need fc layer. i think we have to had fc wight for validate and test. thanks for your answer are you test your solution?

Yes, base my solution, I have run the code successfully with the modified validate(). But the results don’t seem to be excellent.

raminrahimi6970 commented 4 years ago

Do not excellent results because of missing the fully connected layer?

TingquanGao commented 4 years ago

The reason for the unexcellent results seems to be the wrong version of my PyTorch. I checked the network structure, and found that in the forward() of Deeplab_V2, "fc" layers are not seem to be used. So "fc" layers have no effect to the result.

raminrahimi6970 commented 4 years ago

if your result improve with change PyTorch version release version to use. thanks for your answer

raminrahimi6970 commented 4 years ago

Is your results improved with change version of pytorch?

TingquanGao commented 4 years ago

No, the code does not seem to run successfully in my environment. I am still trying.

louxiantuo commented 4 years ago

Actually,So am I.

发送自 Windows 10 版邮件https://go.microsoft.com/fwlink/?LinkId=550986应用


发件人: Tingquan Gao notifications@github.com 发送时间: Saturday, May 23, 2020 7:18:53 PM 收件人: lehaifeng/DASNet DASNet@noreply.github.com 抄送: louxiantuo louxiantuo@outlook.com; Author author@noreply.github.com 主题: Re: [lehaifeng/DASNet] Do u have data about this code?Thank you! (#4)

No, the code does not seem to run successfully in my environment. I am still trying.

― You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/lehaifeng/DASNet/issues/4#issuecomment-633029917, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AETTUB4QC66X6VL2DEDWADDRS6WJ3ANCNFSM4MQAOV5Q.

raminrahimi6970 commented 4 years ago

Hi I run the code in PyTorch=1.3 and pretrained model that was upload but my result not seems very good what is the problem? thanks for your answer

xixi103 commented 4 years ago

Can you tell me how to run this code on Pycharm?