akar43 / lsm

Code for Learnt Stereo Machines based on the NIPS 2017 paper

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Some bug in ops.py proj_splat()

yulinliutw opened this issue · comments

Hello! I run the demo_vlsm.ipynb in recent days.
Then I found some bug make the code can not work.
That bug is in the "proj_splat()", some times, the projection result may out of the 2D feature map.
For example, the feature map has a size 112*112, the index in each dim is 0~111, but some 3D point project to the 2D feature map, the result will be (112,112), then the model can not work.
current time, I modify the _get_gather_inds(x, y) to solve the problem, the code shows as below :
def _get_gather_inds(x, y):
temp = tf.reshape(tf.stack([im_ind, y, x], axis=2), [-1, 3])
correct_tensor = tf.zeros(temp.get_shape(),dtype=tf.dtypes.int32) + 111
result = tf.where(tf.less(temp, 112), temp , correct_tensor)
return result

Even I am facing the same issue I even tried the code given by you @yulinliutw but am still getting error.

InvalidArgumentError: indices[1605631] = [0, 13, 44, -23] does not index into param shape [1,32,32,32,32]
[[node MVNet/ProjSlice/Interp/NearestInterp/GatherNd (defined at ./ops.py:319) ]]