Hello, thanks for your wonderful work, I'm having some problems running the project files locally, can u help me out?
-
How to specify the device (CPU or GPU) when run the demo?
I found that running demo.py directly in the terminal will run with the GPU by default, and the behavior of the CPU run set in the code is not consistent (I found it strange that in Pycharm, Ctrl+Shift+F10 run will use the CPU instead)
In addition, I found that executing the following line returned different results on the CPU and the GPU:
|
dist_nn, ind_nn = tf.nn.top_k(-1 * dist, 2 if ratio_thresh else 1, sorted=False) |
To solve this problem, I simply set the following conditional judgment statement:
if "GPU" in dist.backing_device:
dist_nn = tf.reverse(dist_nn, tf.constant([-1]))
ind_nn = tf.reverse(ind_nn, tf.constant([-1]))
-
Different inference results on CPU and GPU
In addition, I found that the same image runs differently on the CPU and GPU (the first one below is the CPU, the second one is the GPU), including the number of keypoints and matches


To reproduce the problem, my environment is configured as follows:
# nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Sun_Feb_14_21:12:58_PST_2021
Cuda compilation tools, release 11.2, V11.2.152
Build cuda_11.2.r11.2/compiler.29618528_0
# nvidia-smi
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 510.108.03 Driver Version: 510.108.03 CUDA Version: 11.6 |
|-------------------------------+----------------------+----------------------+
# system
ubuntu 18.04
# some python env
python 3.8.16
tensorflow 2.10.0
larq 0.13.0
opencv-python 3.4.14.51
opencv-python 3.4.14.51
opencv-python 3.4.14.51
Thank you again for your outstanding work, can you help me with the above problem? Looking forward to your early reply! :)
Hello, thanks for your wonderful work, I'm having some problems running the project files locally, can u help me out?
How to specify the device (CPU or GPU) when run the demo?
I found that running
demo.pydirectly in the terminal will run with the GPU by default, and the behavior of the CPU run set in the code is not consistent (I found it strange that in Pycharm,Ctrl+Shift+F10run will use the CPU instead)In addition, I found that executing the following line returned different results on the CPU and the GPU:
ZippyPoint/models/matching.py
Line 19 in e0395fb
To solve this problem, I simply set the following conditional judgment statement:
Different inference results on CPU and GPU
In addition, I found that the same image runs differently on the CPU and GPU (the first one below is the CPU, the second one is the GPU), including the number of keypoints and matches
To reproduce the problem, my environment is configured as follows:
Thank you again for your outstanding work, can you help me with the above problem? Looking forward to your early reply! :)