vcg-uvic / lf-net-release

Code Release for LF-Net: Learning Local Features from Images

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error in demo.ipynb

mfaisal59 opened this issue · comments

Hi,
When i run demo.ipynb I get the following error in cell # 13.
Any help is highly appreciated.
image

Sorry, I couldn't reproduce your errors on my side. Could you tell me more details?

Hi, I get a same error, and I find a similar problem at yangyanli/PointCNN#42, where also give us some solutions. It may cause by a tensorflow version problem. I use tf1.8 while author recommend tf1.4.0. For code of LF-Net, line 1143 to 1146 of det_tools.py should be modified. More details can be find in vistart's answer at yangyanli/PointCNN#42.

Hello,
Kwang. It's my pleasure. But I still can't get a real solution at this time. I can give more details that may show something helpful.
What I do making the error disappear is: change line 1143 of det_tools.py which is "x0_safe = tf.clip_by_value(x0, zero, x_max)", to "x0_safe = tf.clip_by_value(x0, zero[0], 200)". Of cause, it's just a way to make sure both para2 and para3 of clip_by_value are scalar (not a tensor with shape [1]), but set para3=200 is wrong.
I think the a reasonable state should be "x0_safe = tf.clip_by_value(x0, zero[0], x_max[0])". But unfortunately the shape of x_max is [], not [1]. In another word, x_max is empty, which I still can't understand the reason. I think line 1140 "x_max = tf.cast(tf.shape(photos)[2] - 1, 'float32')" should work well, but at here I get a empty x_max. My tensorflow version is tensorflow 1.8.0 for python3.6 and CUDA9.1.
I'm not very familiar with tensorflow. I hope above information could give some help. And this LF-Net code help me a lot, thank you very much.

Hello. I can confirm that the demo works when using a docker image with tf==1.4.0 (gpu, py3). I had the same issues with tf==1.80 or tf==latest.