Totoro97/f2-nerf

check failed: input.n() % BATCH_SIZE_GRANULARITY == 0

Opened this issue · 2 comments

I met an error
Do you have any ideas?

terminate called after throwing an instance of 'std::runtime_error'
))J_9WKB`EL(QCA0UUF @LQ
what(): /home/lab/NeRF/f2-nerf/External/tiny-cuda-nn/include/tiny-cuda-nn/object.h:130 check failed: input.n() % BATCH_SIZE_GRANULARITY == 0

hi,I'm having the same problem, how can you fix it? thx!

The following worked for me:

--- a/src/Field/TCNNWP.cpp
+++ b/src/Field/TCNNWP.cpp
@@ -103,7 +103,7 @@ Tensor TCNNWP::Query(const Tensor& pts) {
   auto info = torch::make_intrusive<TCNNWPInfo>();
 
   int batch_size = pts.size(0);
-  int batch_size_al = (batch_size + 127) / 128 * 128;
+  int batch_size_al = (batch_size + 255) / 256 * 256;
   auto pad_opt = torch::nn::functional::PadFuncOptions({ 0LL, 0LL, 0LL, (long long) (batch_size_al - batch_size)});
   Tensor input = torch::nn::functional::pad(pts, pad_opt);