Deep-Live-Cam icon indicating copy to clipboard operation
Deep-Live-Cam copied to clipboard

Issue while running for a pre-recorded video

Open gingerpickle99 opened this issue 1 year ago • 1 comments

getting the following error when clicked on save

set det-size: (640, 640) Exception in Tkinter callback Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/tkinter/init.py", line 1921, in call return self.func(*args) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/customtkinter/windows/widgets/ctk_button.py", line 554, in _clicked self._command() File "/Users/nikhil/Deep-Live-Cam/modules/ui.py", line 95, in start_button = ctk.CTkButton(root, text='Start', cursor='hand2', command=lambda: select_output_path(start)) File "/Users/nikhil/Deep-Live-Cam/modules/ui.py", line 192, in select_output_path start() File "/Users/nikhil/Deep-Live-Cam/modules/core.py", line 192, in start if predict_video(modules.globals.target_path): File "/Users/nikhil/Deep-Live-Cam/modules/predicter.py", line 24, in predict_video _, probabilities = opennsfw2.predict_video_frames(video_path=target_path, frame_interval=100) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/opennsfw2/_inference.py", line 114, in predict_video_frames model = make_open_nsfw_model(weights_path=weights_path) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/opennsfw2/_model.py", line 138, in make_open_nsfw_model x = tf.pad(x, [[0, 0], [3, 3], [3, 3], [0, 0]], "CONSTANT") File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/tensorflow/python/util/traceback_utils.py", line 153, in error_handler raise e.with_traceback(filtered_tb) from None File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/keras/src/backend/common/keras_tensor.py", line 91, in tf_tensor raise ValueError( ValueError: A KerasTensor cannot be used as input to a TensorFlow function. A KerasTensor is a symbolic placeholder for a shape and dtype, used when constructing Keras Functional models or Keras Functions. You can only use it as input to a Keras layer or a Keras operation (from the namespaces keras.layers and keras.operations). You are likely doing something like:

x = Input(...)
...
tf_fn(x)  # Invalid.

What you should do instead is wrap tf_fn in a layer:

class MyLayer(Layer):
    def call(self, x):
        return tf_fn(x)

x = MyLayer()(x)

gingerpickle99 avatar Aug 11 '24 05:08 gingerpickle99

May you can try: pip install opennsfw2==0.13.10 Good lucky.

yizhangliu avatar Aug 12 '24 13:08 yizhangliu