liteflownet-tf2 icon indicating copy to clipboard operation
liteflownet-tf2 copied to clipboard

IndexError: index -2147483648 is out of bounds for axis 0 with size 55

Open mohamedabdallah1996 opened this issue 4 years ago • 1 comments

After following all the steps and running this line !python eval.py --img1=./images/first.png --img2=./images/second.png --flow=./out.flow --display_flow=True

I got this error:

2020-07-21 10:55:35.414384: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcuda.so.1
2020-07-21 10:55:35.417596: E tensorflow/stream_executor/cuda/cuda_driver.cc:318] failed call to cuInit: CUDA_ERROR_NO_DEVICE: no CUDA-capable device is detected
2020-07-21 10:55:35.417657: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:156] kernel driver does not appear to be running on this host (f67b6b6649c6): /proc/driver/nvidia/version does not exist
2020-07-21 10:55:35.418050: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2020-07-21 10:55:35.425086: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2300000000 Hz
2020-07-21 10:55:35.425369: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x1bf6bc0 executing computations on platform Host. Devices:
2020-07-21 10:55:35.425406: I tensorflow/compiler/xla/service/service.cc:175]   StreamExecutor device (0): Host, Default Version
WARNING:tensorflow:From /root/.local/lib/python3.6/site-packages/tensorflow_core/python/ops/resource_variable_ops.py:1630: calling BaseResourceVariable.__init__ (from tensorflow.python.ops.resource_variable_ops) with constraint is deprecated and will be removed in a future version.
Instructions for updating:
If using Keras pass *_constraint arguments to layers.
Traceback (most recent call last):
  File "eval.py", line 58, in <module>
    flow_color = flow_to_color(flow, convert_to_bgr=False)
  File "/content/drive/My Drive/Research Repos/optical flow/liteflownet-tf2/draw_flow.py", line 124, in flow_to_color
    return flow_compute_color(u, v, convert_to_bgr)
  File "/content/drive/My Drive/Research Repos/optical flow/liteflownet-tf2/draw_flow.py", line 83, in flow_compute_color
    col0 = tmp[k0] / 255.0
IndexError: index -2147483648 is out of bounds for axis 0 with size 55

mohamedabdallah1996 avatar Jul 21 '20 11:07 mohamedabdallah1996

Same here. What I found is that the sess returns an array of NaNs flow = sess.run(out, feed_dict={tens1: inp1, tens2: inp2})[0, :h, :w, :]

But the problem only occurs in the part where you'd use it the first time, which happens to be col0 = tmp[k0] / 255.0 as k0 and k1 should get their values from there

kristofcsaszar avatar Jul 24 '20 14:07 kristofcsaszar