New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RuntimeError: The size of tensor a (96774) must match the size of tensor b (290322) at non-singleton dimension 0 #6
Comments
Hi @chenwydj, thanks for your amazing works. I'm trying to rerun your experiments on DeepGlobe. Traceback (most recent call last):
File "train_deep_globe.py", line 129, in <module>
loss = trainer.train(sample_batched, model, global_fixed)
File "/root/ultra_high_resolution_segmentation/helper.py", line 429, in train
self.metrics_global.update(labels_npy, predictions_global)
File "/root/ultra_high_resolution_segmentation/utils/metrics.py", line 23, in update
tmp = self._fast_hist(lt.flatten(), lp.flatten(), self.n_classes)
File "/root/ultra_high_resolution_segmentation/utils/metrics.py", line 18, in _fast_hist
hist = np.bincount(n_class * label_true[mask].astype(int) + label_pred[mask], minlength=n_class**2).reshape(n_class, n_class)
IndexError: boolean index did not match indexed array along dimension 0; dimension is 5992704 but corresponding boolean dimension is 17978112 So I've been thinking my fix might not be how thing should be ... Thanks ;) |
I have encountered the same problem, have you solved it? |
@zxshi I haven't :3 ... |
have you solved it? |
Solved for binary segmantation |
can you tell me how to solve it?do you still use this code? |
I solve it by making sure that the predicted tensor tensor and the target mask tensor have the same number of channel. You can see the code at https://github.com/lamhoangtung/ultra_high_resolution_segmentation/tree/master But keep in mind this only work for binary semantic segmantation yet |
thank you very much!!!it will help |
@lamhoangtung when I train mode=3 I have a problem:AttributeError: 'Trainer' object has no attribute 'template'? |
hi,I want to study this code,and i didn't get a profound comprehension to the Semantic segmentation ,could you please explain the function and distinguish in mode(1,2,3),thank you very much! |
你好,我想你应该是中国人吧,我最近才看这个,知道这个网络结构主要是由全局信息融合局部信息,但是在代码里看到了有三种mode,这三种mode是网络结构不同吗,还是训练的结果不一样? |
多谢讲解!!!让我有了进一步的理解 |
I'm trying to train with mode 3 now but I'm getting NAN loss because the forward pass are giving me NAN tensor. Still looking into it for now ;). Code at the |
Use my fork code, branch |
thank you very much !
…------------------ 原始邮件 ------------------
发件人: "Hoàng Tùng Lâm (Linus)"<notifications@github.com>;
发送时间: 2019年8月3日(星期六) 凌晨1:15
收件人: "chenwydj/ultra_high_resolution_segmentation"<ultra_high_resolution_segmentation@noreply.github.com>;
抄送: "1416055750"<1416055750@qq.com>;"Mention"<mention@noreply.github.com>;
主题: Re: [chenwydj/ultra_high_resolution_segmentation] RuntimeError: Thesize of tensor a (96774) must match the size of tensor b (290322) atnon-singleton dimension 0 (#6)
@zzx0836 I fixed that in e3c5128 ;). Mode 3 are going well now :P
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Hi, have you fix this problem ? |
hi,could you please tell me which dataset you used in this code,i see that the author didnt provide the training code for AerialImageDataset。 |
I'm using my own dataset, and the data is fundus data.
…------------------ 原始邮件 ------------------
发件人: "湖北工业停水停电大学"<notifications@github.com>;
发送时间: 2019年8月23日(星期五) 上午10:30
收件人: "TAMU-VITA/GLNet"<GLNet@noreply.github.com>;
抄送: "1416055750"<1416055750@qq.com>;"Mention"<mention@noreply.github.com>;
主题: Re: [TAMU-VITA/GLNet] RuntimeError: The size of tensor a (96774) mustmatch the size of tensor b (290322) at non-singleton dimension 0 (#6)
hi,could you please tell me which dataset you used in this code,i see that the author didnt provide the training code for AerialImageDataset。
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@zzx0836,thank you,i use the code which forked by lumhoangtung,and it woks |
You're welcome!
…------------------ 原始邮件 ------------------
发件人: "湖北工业停水停电大学"<notifications@github.com>;
发送时间: 2019年8月30日(星期五) 下午3:00
收件人: "TAMU-VITA/GLNet"<GLNet@noreply.github.com>;
抄送: "1416055750"<1416055750@qq.com>;"Mention"<mention@noreply.github.com>;
主题: Re: [TAMU-VITA/GLNet] RuntimeError: The size of tensor a (96774) mustmatch the size of tensor b (290322) at non-singleton dimension 0 (#6)
@zzx0836,thank you,i use the code which forked by lumhoangtung,and it woks
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
hi,can you run it on deepglobe dataset? I have used your code on AerialImageDataset,but failed on deepglobe |
No I can't :3 |
Hi! We updated the instructions for training and evaluation in the Readme, and also uploaded the pretrained model for the Deep Globe. The updated training and evaluation bash scripts work on my side. Please take a look and give a try! :) |
Thanks a lot @chenwydj. It worked ;) |
I'm trying to rerun your code but I encounter this:
Any ideal how to fix this @chenwydj ? Thanks a lot.
The text was updated successfully, but these errors were encountered: