Open dirkpitt2050 opened 3 years ago
Thank you very much for reporting this issue. We will investigate and get back to you.
Some extra info:
The eval.py script as-is probably fails with a different issue (incorrect depth). This is my patch to crop the images before running the model (to get the NSException above):
diff --git a/eval.py b/eval.py
index 25e308d..bb0a8fc 100644
--- a/eval.py
+++ b/eval.py
@@ -59,8 +59,17 @@ else:
# Load images
inp1 = Image.open(args.img1)
inp2 = Image.open(args.img2)
-
-w, h = inp1.size[:2]
+inp1 = np.asarray(inp1)
+inp2 = np.asarray(inp2)
+
+#w, h = inp1.size[:2]
+fullh, fullw, _ = inp1.shape
+w = 896
+h = 320
+dw = (fullw-w)//2
+dh = (fullh-h)//2
+inp1 = inp1[dh:dh+h, dw:dw+w, 0:3]
+inp2 = inp2[dh:dh+h, dw:dw+w, 0:3]
inp1 = np.float32(np.expand_dims(pad_image(np.asarray(inp1)[..., ::-1]), 0)) / 255.0
inp2 = np.float32(np.expand_dims(pad_image(np.asarray(inp2)[..., ::-1]), 0)) / 255.0
following KITTI dimensions in this table at https://github.com/twhui/LiteFlowNet#Datasets
. | FlyingChairs | FlyingThings3D | Sintel | KITTI |
---|---|---|---|---|
Crop size | 448 x 320 | 768 x 384 | 768 x 384 | 896 x 320 |
Batch size | 8 | 4 | 4 | 4 |
I am trying to run this model here: https://github.com/rogerhcheng/LiteFlowNet2-TF2
It crashes with warnings about TensorFlow Addons custom ops...
... followed by:
I am running Intel 2019 MBP 16, Big Sur 11.1, Xcode 12.3.
Steps to reproduce:
pip install matplotlib
cd LiteFlowNet2-TF2
python eval.py --img1=images/first.png --img2=images/second.png --use_Sintel=False --display_flow=True --img_out=flow000006.png
Setting
TF_ADDONS_PY_OPS
does not help. I get the same thing even when disabling eager execution and when using cpu or gpu.