Any suggestions?
TensorFlow Version: 2.1.0
TensorFlow Addons Version: 0.8.2
NumPy Version: 1.21.5
The NotImplementedError error you encountered indicates a problem with the use of tf.meshgrid in the dense_image_warp function of tensorflow_addons. The error message "Cannot convert a symbolic Tensor to a numpy array" suggests that a symbolic tensor from TensorFlow cannot be converted into a NumPy array. This is a known issue in TensorFlow 2.x, often related to the compatibility between TensorFlow and NumPy versions.
To address this issue, try the following steps:
Update TensorFlow and TensorFlow Addons: Ensure you are using the latest versions of TensorFlow and TensorFlow Addons. Sometimes, such issues are resolved in updated versions.
Check TensorFlow and NumPy Versions: Some TensorFlow versions may not be fully compatible with specific NumPy versions. You might need to experiment with different version combinations.
(super-slomo) PS E:\vedio-interpolation\Super-SolMo\Super-SloMo-tf2-master> python super-slomo/inference.py resources/UAV/1.mp4 resources/UAV/1output.mp4 --model chckpnt259/ckpt-259 --n_frames 20 --fps 480
following is error information_______________
2023-12-31 19:29:04.119197: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2
WARNING:tensorflow:AutoGraph could not transform <function load_dataset.. at 0x000002316D37A1F8> and will run it as-is.
Please report this to the TensorFlow team. When filing the bug, set the verbosity to 10 (on Linux, export AUTOGRAPH_VERBOSITY=10
) and attach the full output.
Cause: No module named 'tensorflow_core.estimator'
WARNING:tensorflow:AutoGraph could not transform <function load_frames at 0x000002316D0DE708> and will run it as-is.
Please report this to the TensorFlow team. When filing the bug, set the verbosity to 10 (on Linux, export AUTOGRAPH_VERBOSITY=10
) and attach the full output.
Cause: No module named 'tensorflow_core.estimator'
WARNING:tensorflow:AutoGraph could not transform <function dense_image_warp at 0x000002316D227E58> and will run it as-is.
Please report this to the TensorFlow team. When filing the bug, set the verbosity to 10 (on Linux, export AUTOGRAPH_VERBOSITY=10
) and attach the full output.
Cause: No module named 'tensorflow_core.estimator'
Traceback (most recent call last):
File "super-slomo/inference.py", line 164, in
main()
File "super-slomo/inference.py", line 159, in main
predict(video_path, model_path, output_path, args.n_frames, args.fps)
File "super-slomo/inference.py", line 120, in predict
predictions, _ = model(frames + ([f],), training=False)
File "E:\Miniconda3\envs\super-slomo\lib\site-packages\tensorflow_core\python\keras\engine\base_layer.py", line 822, in call
outputs = self.call(cast_inputs, *args, **kwargs)
File "E:\jupyterDir\vedio-interpolation\Super-SolMo\Super-SloMo-tf2-master\super-slomo\models\slomo_model.py", line 31, in call
f_t0, v_t0, f_t1, v_t1, g_i0_ft0, g_i1_ft1 = self.optical_flow(optical_input)
File "E:\Miniconda3\envs\super-slomo\lib\site-packages\tensorflow_core\python\keras\engine\base_layer.py", line 822, in call
outputs = self.call(cast_inputs, *args, **kwargs)
File "E:\jupyterDir\vedio-interpolation\Super-SolMo\Super-SloMo-tf2-master\super-slomo\models\layers.py", line 166, in call
g_i0_ft0 = self.backwarp_layer_t0([frames_0, f_t0_t])
File "E:\Miniconda3\envs\super-slomo\lib\site-packages\tensorflow_core\python\keras\engine\base_layer.py", line 822, in call
outputs = self.call(cast_inputs, *args, **kwargs)
File "E:\jupyterDir\vedio-interpolation\Super-SolMo\Super-SloMo-tf2-master\super-slomo\models\layers.py", line 142, in call
img_backwarp = self.backwarp(image, flow)
File "E:\Miniconda3\envs\super-slomo\lib\site-packages\tensorflow_core\python\eager\def_function.py", line 568, in call
result = self._call(*args, **kwds)
File "E:\Miniconda3\envs\super-slomo\lib\site-packages\tensorflow_core\python\eager\def_function.py", line 615, in _call
self._initialize(args, kwds, add_initializers_to=initializers)
File "E:\Miniconda3\envs\super-slomo\lib\site-packages\tensorflow_core\python\eager\def_function.py", line 497, in _initialize
*args, **kwds))
File "E:\Miniconda3\envs\super-slomo\lib\site-packages\tensorflow_core\python\eager\function.py", line 2389, in _get_concrete_function_internal_garbage_collected
graph_function, _, _ = self._maybe_define_function(args, kwargs)
File "E:\Miniconda3\envs\super-slomo\lib\site-packages\tensorflow_core\python\eager\function.py", line 2703, in _maybe_define_function
graph_function = self._create_graph_function(args, kwargs)
File "E:\Miniconda3\envs\super-slomo\lib\site-packages\tensorflow_core\python\eager\function.py", line 2593, in _create_graph_function
capture_by_value=self._capture_by_value),
File "E:\Miniconda3\envs\super-slomo\lib\site-packages\tensorflow_core\python\framework\func_graph.py", line 978, in func_graph_from_py_func
func_outputs = python_func(*func_args, **func_kwargs)
File "E:\Miniconda3\envs\super-slomo\lib\site-packages\tensorflow_core\python\eager\def_function.py", line 439, in wrapped_fn
return weak_wrapped_fn().wrapped(*args, **kwds)
File "E:\Miniconda3\envs\super-slomo\lib\site-packages\tensorflow_core\python\framework\func_graph.py", line 968, in wrapper
raise e.ag_error_metadata.to_exception(e)
NotImplementedError: in converted code:
E:\Miniconda3\envs\super-slomo\lib\site-packages\tensorflow_addons\image\dense_image_warp.py:235 dense_image_warp
grid_x, grid_y = tf.meshgrid(tf.range(width), tf.range(height))
E:\Miniconda3\envs\super-slomo\lib\site-packages\tensorflow_core\python\ops\array_ops.py:3065 meshgrid
mult_fact = ones(shapes, output_dtype)
E:\Miniconda3\envs\super-slomo\lib\site-packages\tensorflow_core\python\ops\array_ops.py:2659 ones
output = _constant_if_small(one, shape, dtype, name)
E:\Miniconda3\envs\super-slomo\lib\site-packages\tensorflow_core\python\ops\array_ops.py:2391 _constant_if_small
if np.prod(shape) < 1000:
<__array_function__ internals>:6 prod
E:\Miniconda3\envs\super-slomo\lib\site-packages\numpy\core\fromnumeric.py:3052 prod
keepdims=keepdims, initial=initial, where=where)
E:\Miniconda3\envs\super-slomo\lib\site-packages\numpy\core\fromnumeric.py:86 _wrapreduction
return ufunc.reduce(obj, axis, dtype, out, **passkwargs)
E:\Miniconda3\envs\super-slomo\lib\site-packages\tensorflow_core\python\framework\ops.py:728 __array__
" array.".format(self.name))
NotImplementedError: Cannot convert a symbolic Tensor (dense_image_warp/meshgrid/Size_1:0) to a numpy array.