JiaRenChang / PSMNet

Pyramid Stereo Matching Network (CVPR2018)
MIT License
1.43k stars 423 forks source link

IndexError: index 99 is out of bounds for dimension 1 with size 1 #218

Open Jack47746 opened 3 years ago

Jack47746 commented 3 years ago

作者您好,冒昧的打扰您,感谢您对代码的分享。我最近在复现您给的代码的时候遇到了这样一个错误,不知道如何解决,希望您能指点一二。本人小白一枚,我认为错误的行在index = np.argwhere(true_disp>0),但是不知道如何更改,谢谢您!(我是这样训练的:用Scene Flow模型运行main进行训练,然后加载训练结果,用KT2015运行finetune进行微调) image image

Jack47746 commented 3 years ago

已解决。

pridexin commented 3 years ago

你好遇到了同样的问题,请问是如何解决的呢?

Jack47746 commented 3 years ago

@pridexin https://github.com/JiaRenChang/PSMNet/issues/217#issue-925628747

pridexin commented 3 years ago

@pridexin #217 (comment)

谢谢!我好像遇到了和您当初一样的问题,请问您cpu溢出的问题是怎么解决的呀

Jack47746 commented 3 years ago

我暂时也没找到解决方法....你有什么好的办法不?

pridexin commented 3 years ago

我暂时也没找到解决方法....你有什么好的办法不?

还在研究当中,有方案了告诉你

Jack47746 commented 3 years ago

朋友,你有微信吗

Jack47746 commented 3 years ago

你有邮箱吗

发自我的iPhone

------------------ Original ------------------ From: pridexin @.> Date: Mon,Jun 28,2021 0:34 PM To: JiaRenChang/PSMNet @.> Cc: Jack47746 @.>, State change @.> Subject: Re: [JiaRenChang/PSMNet] IndexError: index 99 is out of bounds for dimension 1 with size 1 (#218)

Jack47746 commented 3 years ago

你把你的微信发我邮箱吧,b站我没看到..

发自我的iPhone

------------------ Original ------------------ From: pridexin @.> Date: Mon,Jun 28,2021 3:52 PM To: JiaRenChang/PSMNet @.> Cc: Jack47746 @.>, State change @.> Subject: Re: [JiaRenChang/PSMNet] IndexError: index 99 is out of bounds for dimension 1 with size 1 (#218)

我关注了你的b站账号,你看下私信

------------------ 原始邮件 ------------------ 发件人: "JiaRenChang/PSMNet" @.>; 发送时间: 2021年6月28日(星期一) 中午12:43 @.>; @.**@.>; 主题: Re: [JiaRenChang/PSMNet] IndexError: index 99 is out of bounds for dimension 1 with size 1 (#218)

你有邮箱吗

发自我的iPhone

------------------ Original ------------------
From: pridexin @.>
Date: Mon,Jun 28,2021 0:34 PM
To: JiaRenChang/PSMNet
@.>
Cc: Jack47746 @.>, State change @.>
Subject: Re: [JiaRenChang/PSMNet] IndexError: index 99 is out of bounds for dimension 1 with size 1 (#218)
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe. — You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or unsubscribe.

hubery4 commented 3 years ago

@Jack47746 @pridexin The error of the problem is still the dimension of true_disp and pred_disp, where I put the ‘:’ in the wrong place. true_disp has dimension (1, 368, 1232), while pred_disp has (1,1, 368, 1232). It hence should be corrected as the pred_disp[:, index[0][:], index[1][:], index[2][:]]**** when calculating disp_true.

aihaoc commented 3 years ago

@pridexin #217 (comment)

谢谢!我好像遇到了和您当初一样的问题,请问您cpu溢出的问题是怎么解决的呀

请问cpu溢出问题解决了吗?

keepuplearning commented 2 years ago

@Jack47746 @pridexin The error of the problem is still the dimension of true_disp and pred_disp, where I put the ‘:’ in the wrong place. true_disp has dimension (1, 368, 1232), while pred_disp has (1,1, 368, 1232). It hence should be corrected as the pred_disp[:, index[0][:], index[1][:], index[2][:]]**** when calculating disp_true.

Hello, I have an question about the code here. In my opinion, Index[0][:] is a list which contains 4 elements, so I don't understand why this 'disp_true[index[0][:], index[1][:], index[2][:]]' can run.

babyblue-wsz commented 1 year ago

@Jack47746 @pridexin The error of the problem is still the dimension of true_disp and pred_disp, where I put the ‘:’ in the wrong place. true_disp has dimension (1, 368, 1232), while pred_disp has (1,1, 368, 1232). It hence should be corrected as the pred_disp[:, index[0][:], index[1][:], index[2][:]]**** when calculating disp_true.

Thank you so much!!! I read all your comments in #218 #217 and #216, and solved my problem by setting batch_size to 1, and correcting the calculating expression of "pred_disp". I used NVIDIA 2080TI.