TensorflowPredict RuntimeError: Descriptor name not found #1466
Unanswered
alice-gn-open
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, I am trying to use Essentia to analyze music mood using mood_sad-msd-musicnn-1.pb as my classification model. However, when running TensorflowPredict, I encounter the following error:
RuntimeError: In TensorflowPredict.compute: Descriptor name 'model/Placeholder' of type Eigen::Tensor<float, 4, 1, long> not found
I have already checked the model's metadata using Netron, and I found that:
Input node: model/Placeholder
Output node: model/Softmax
Despite correctly setting these names in my code, the error persists.
Steps to Reproduce
Here is my code:
import numpy as np
import essentia
import essentia.standard as es
Paths
audio_path = "/models/1.mp3"
embedding_model_path = "/models/msd-musicnn-1.pb"
mood_model_path = "/models/mood_sad-msd-musicnn-1.pb"
Step 1: Load Audio
audio = es.MonoLoader(filename=audio_path, sampleRate=16000)()
Step 2: Extract Embeddings
embedding_model = es.TensorflowPredictMusiCNN(graphFilename=embedding_model_path)
embeddings = embedding_model(audio)
Step 3: Average Pooling (Reduce Dimensions)
embeddings_pooled = np.mean(embeddings, axis=0)
input_data = embeddings_pooled.reshape(1, 200, 1, 1).astype(np.float32)
Step 4: Run Mood Classification
INPUT_NODE_NAME = "model/Placeholder"
OUTPUT_NODE_NAME = "model/Softmax"
pool = essentia.Pool()
pool.add(INPUT_NODE_NAME, input_data)
mood_model = es.TensorflowPredict(
graphFilename=mood_model_path,
inputs=[INPUT_NODE_NAME],
outputs=[OUTPUT_NODE_NAME],
squeeze=True
)
output_pool = mood_model(pool)
mood_predictions = output_pool[OUTPUT_NODE_NAME]
print(f"Non-Sad Score: {mood_predictions[0]:.4f}")
print(f"Sad Score: {mood_predictions[1]:.4f}")
What I Have Tried
Verified Model Structure:
Used Netron to confirm the model's input and output node names.
Ensured model/Placeholder is used correctly.
Adjusted Input Data Format:
Reshaped embeddings to (1, 200, 1, 1), based on the metadata which specifies shape=[200].
Tested on Different Models:
msd-musicnn-1.pb for embeddings extraction works correctly.
mood_sad-msd-musicnn-1.pb fails with TensorflowPredict.
Environment Details
Essentia Version: (Check using python3 -c "import essentia; print(essentia.version)")
TensorFlow Version: 1.15.0 (python3 -c "import tensorflow as tf; print(tf.version)")
OS: Ubuntu 18.04 (running in Docker)
Python Version: 3.6.9
Expected Behavior
I expect the mood classifier (mood_sad-msd-musicnn-1.pb) to process the embeddings correctly and return a prediction.
Actual Behavior
Instead, TensorflowPredict raises:
RuntimeError: In TensorflowPredict.compute: Descriptor name 'model/Placeholder' of type Eigen::Tensor<float, 4, 1, long> not found
Questions
Am I using the correct input format for mood_sad-msd-musicnn-1.pb?
Is TensorflowPredict compatible with this model, or should I use TensorflowPredict2D?
Are there any known issues with running this in Docker?
I would appreciate any insights or suggestions. Thank you in advance! 😊
Beta Was this translation helpful? Give feedback.
All reactions