Skip to content

Conversation

@hutauf
Copy link

@hutauf hutauf commented Feb 12, 2022

``If I'm using the demo code from the readme, the models are initiated with random weights and the audioset-weights are not being loaded. Here is some demo-code showing that the model is different. This should give two identical results. But if you remove the "weights" argument, it will give two different results.

import librosa
import numpy as np
import vggish_keras as vgk
import tensorflow as tf

y, sr = librosa.load(librosa.util.example_audio_file())

tf.random.set_seed(1)
compute = vgk.get_embedding_function(hop_duration=0.25, weights='audioset')
Z, ts = compute(y=y, sr=sr)
print("first run", Z.flatten()[:10])

tf.random.set_seed(2)
compute = vgk.get_embedding_function(hop_duration=0.25, weights='audioset')
Z, ts = compute(y=y, sr=sr)
print("second run", Z.flatten()[:10])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant