Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in training a custom classifier using Ubuntu CLI #478

Open
AdityaPanigrahy opened this issue Oct 23, 2024 · 2 comments
Open

Error in training a custom classifier using Ubuntu CLI #478

AdityaPanigrahy opened this issue Oct 23, 2024 · 2 comments

Comments

@AdityaPanigrahy
Copy link

So, I made a few local changes to log the epoch history using tensorboard callbacks (mostly to plot the training and evaluation loss). It worked for few models. I then restored the repository to its original form, stashing the local changes. But now on training I recieve this error. analyze.py and embeddings.py work fine though. Only train.py has this issue.

multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/home/birdlab/miniconda3/envs/birdnet/lib/python3.10/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
  File "/home/birdlab/softs/BirdNet_CLI/BirdNET-Analyzer/train.py", line 60, in _loadAudioFile
    embeddings = model.embeddings(batch_sig)
  File "/home/birdlab/softs/BirdNet_CLI/BirdNET-Analyzer/model.py", line 640, in embeddings
    features = INTERPRETER.get_tensor(OUTPUT_LAYER_INDEX)
  File "/home/birdlab/miniconda3/envs/birdnet/lib/python3.10/site-packages/tensorflow/lite/python/interpreter.py", line 888, in get_tensor
    return self._interpreter.GetTensor(tensor_index, subgraph_index)
ValueError: Tensor data is null. Run allocate_tensors() first
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/birdlab/softs/BirdNet_CLI/BirdNET-Analyzer/train.py", line 437, in <module>
    trainModel()
  File "/home/birdlab/softs/BirdNet_CLI/BirdNET-Analyzer/train.py", line 213, in trainModel
    x_train, y_train, labels = _loadTrainingData(cfg.TRAIN_CACHE_MODE, cfg.TRAIN_CACHE_FILE, on_data_load_end)
  File "/home/birdlab/softs/BirdNet_CLI/BirdNET-Analyzer/train.py", line 172, in _loadTrainingData
    result = task.get()
  File "/home/birdlab/miniconda3/envs/birdnet/lib/python3.10/multiprocessing/pool.py", line 774, in get
    raise self._value
ValueError: Tensor data is null. Run allocate_tensors() first

Can someone help me out here to as what exactly is happening?

@Josef-Haupt
Copy link
Collaborator

Hard to tell, if embeddings works on its own, this piece of code should work too, in theory atleast. What exactly did you change in your local repo?

@AdityaPanigrahy
Copy link
Author

I had just added a tensor-flow callbacks option to save the epoch history logs and plot the custom loss for training vs validation. But I had stashed the changes and it was back to original code when this error popped up.

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

No branches or pull requests

2 participants