79713493

Date: 2025-07-24 14:01:54
Score: 0.5
Natty:
Report link

To attempt reproducing this, I created the following to generate the output/song.wav file:

import numpy as np
import wave
import os

os.makedirs("output", exist_ok=True)
wav_path = "output/song.wav"

duration_sec = 3
sample_rate = 16000
tone_freq = 440

t = np.linspace(0, duration_sec, int(sample_rate * duration_sec), False)

tone = 0.5 * np.sin(2 * np.pi * tone_freq * t[:sample_rate])
silence = np.zeros(sample_rate * 2)
audio = np.concatenate([tone, silence])

audio_int16 = (audio * 32767).astype(np.int16)

with wave.open(wav_path, 'w') as f:
    f.setnchannels(1)
    f.setsampwidth(2)
    f.setframerate(sample_rate)
    f.writeframes(audio_int16.tobytes())

With the dummy file, if I run the current script, I get an output of:
('noise', 0.0, 1.0)

('noEnergy', 1.0, 2.98)

For context, this is using Python 3.11 which matches the version you're running based on the logs, and using Tensorflow 2.19. When using Python 3.11, the lowest version of Tensorflow that can be used is 2.14.0 (all lower versions don't have the compatibility tag cp311 ), which also runs successfully.

Regarding version compatibility speculation and using the tf.compat.v1 utility functions for resetting the graph, inaSpeechSegmenter doesn't have a Tensorflow pin and in the documentation mentions supporting 3.7 - 3.12. The associated Dockerfile is using Tensorflow 2.8 as well, suggesting the current implementation isn't using the Tensorflow 1 API.

For better clarification, can you provide the versions of each library you're using? This error is more typical in TensorFlow 1.x when modifying a finalized static graph, as others have pointed out. If you're using TensorFlow 2.x, the load_model() function should work in eager mode unless you're loading a model saved in a legacy TF1 format or calling it in a constrained execution context (e.g., inside a @tf.function, or using a mixed session/graph setup in another snippet of code within the module).

Reasons:
  • RegEx Blacklisted phrase (2.5): can you provide
  • Long answer (-1):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • High reputation (-1):
Posted by: danielcahall