weiyithu / NerfingMVS

[ICCV 2021 Oral] NerfingMVS: Guided Optimization of Neural Radiance Fields for Indoor Multi-view Stereo
MIT License
435 stars 58 forks source link

IndexError: list index out of range #15

Closed ycj1124 closed 3 years ago

ycj1124 commented 3 years ago

when I follow the instructions and do the "sh run.sh scene0000_01" ,it was successful at first but when it comes to the :"Depths prior training begins !",it happens to occur the error as follow: Depths prior training begins ! Dowloading https://storage.googleapis.com/mannequinchallenge-data/checkpoints/best_depth_Ours_Bilinear_inc_3_net_G.pth to /home/ycj/NerfingMVS/models/depth_priors/mc.pth ... 100% [....................................................] 21619796 / 21619796point number: 4696662 Traceback (most recent call last): File "run.py", line 19, in depth_priors.train(args) File "/home/ycj/NerfingMVS/src/depth_priors.py", line 70, in train args.depth_H, args.depth_W) File "/home/ycj/NerfingMVS/utils/io_utils.py", line 27, in load_colmap ply_masks = read_ply_mask(ply_path) File "/home/ycj/NerfingMVS/utils/colmap_utils.py", line 49, in read_ply_mask load_point_vis(ply_vis_path, masks) File "/home/ycj/NerfingMVS/utils/colmap_utils.py", line 35, in load_point_vis masks[idx][v, u] = 1 IndexError: list index out of range

could you tell me the reason?thx

ycj1124 commented 3 years ago

and when I try the "sh run.sh scene0079_00" to run another data, I found the error "struct.error: unpack requires a buffer of 12 bytes" . I check the issue and find the same questions and your reply ,but I am sure I was under your instructions in the usage and not replacing colmap with the original version. but I check the colmap/src/mvs/fusion.cc and I find here: void WritePointsVisibility( const std::string& path, const std::vector<std::vector>& points_visibility) { std::fstream file(path, std::ios::out | std::ios::binary); CHECK(file.is_open()) << path;

WriteBinaryLittleEndian(&file, points_visibility.size());

for (const auto& visibility : points_visibility) { WriteBinaryLittleEndian(&file, visibility.size()); for (const auto& image_idx : visibility) { WriteBinaryLittleEndian(&file, image_idx); } } }

it lacks 2 sentences with your version. Is this a problem for the whole situation?or by the way ,maybe I make a wrong install in colmap .could you update the part of the the colmap instructions?I am a little confused when following the instructions in that website. I would be really appreciated if you could teach me.

weiyithu commented 3 years ago

When you follow the colmap instructions, did you run git clone https://github.com/colmap/colmap.git? If you run this command, the colmap folder will be replaced by original version.

colmap
ycj1124 commented 3 years ago

When you follow the colmap instructions, did you run git clone https://github.com/colmap/colmap.git? If you run this command, the colmap folder will be replaced by original version. colmap

I try again and did not run git clone from the link.but the situation still exists.should I add the sentence in the "colmap/src/mvs/fusion.cc" to make sure it is exactly same as the one you mentioned in #2 ?

ycj1124 commented 3 years ago

When you follow the colmap instructions, did you run git clone https://github.com/colmap/colmap.git? If you run this command, the colmap folder will be replaced by original version. colmap

I change the code in "colmap/src/mvs/fusion.cc" and now it is what its like: void WritePointsVisibility( const std::string& path, const std::vector<std::vector>& points_visibility) { std::fstream file(path, std::ios::out | std::ios::binary); CHECK(file.is_open()) << path;

WriteBinaryLittleEndian(&file, points_visibility.size());

for (const auto& visibility : points_visibility) { WriteBinaryLittleEndian(&file, visibility.size()); for (const auto& image_idx : visibility) { WriteBinaryLittleEndian(&file, image_idx); WriteBinaryLittleEndian(&file, pv.u); WriteBinaryLittleEndian(&file, pv.v); } } }

} // namespace mvs } // namespace colmap

but the situation remains.I did not know how could this happen... could you give me some suggestions?I am really anxious and I really want to learn from your program.thanks a lot.

weiyithu commented 3 years ago

Oh, did you also run the following command? This command will checkout dev branch, which is not the correct branch. You can try again without running 'git clone https://github.com/colmap/colmap.git' and 'git checkout dev'

微信图片_20211022174246

.

ycj1124 commented 3 years ago

Oh, did you also run the following command? This command will checkout dev branch, which is not the correct branch. You can try again without running 'git clone https://github.com/colmap/colmap.git' and 'git checkout dev' 微信图片_20211022174246 .

thank you ,I did run that command .I will try again later.have a nice weekend!

weiyithu commented 3 years ago

Hhhhh,the same to you and thanks for your interest of our work.

ycj1124 commented 3 years ago

Hhhhh,the same to you and thanks for your interest of our work.

by following your instrcutions ,I have figured the problem.thank you very much!

ygjwd12345 commented 2 years ago

I also add ' WriteBinaryLittleEndian(&file, pv.u); WriteBinaryLittleEndian(&file, pv.v); ' But I face an error image

nitishkiitk commented 1 year ago

Hhhhh,the same to you and thanks for your interest of our work.

by following your instrcutions ,I have figured the problem.thank you very much!

Hey @ygjwd12345, I am facing the same issue but unable to fix can you please guide me for the same?

ygjwd12345 commented 1 year ago

My solution may be a little bit stupid. if you split run.py into train.py and valid.py the problem is fixed.

nitishkiitk commented 1 year ago

@ygjwd12345 Thanks for your response. Can you send me the split train and validation file? Also if any instruction that needed.

ygjwd12345 commented 1 year ago

You can check https://github.com/ygjwd12345/MTNeRF.

nitishkiitk commented 1 year ago

the commands will be the same or do something needs to be changed? I want to first run the code for demo