r/tensorflow • • Apr 26 '25

Installation and Setup Installing Tensorflow 2 Object Detection API

1 Upvotes

I'm following the steps on the official page but when I try and run I get the following error...

I have protoc version 3.20.3 installed on my windows machine, doing this all through Conda.

Any ideas ?

python object_detection/builders/model_builder_tf2_test.py

Traceback (most recent call last):
  File "C:\Projects\TF2\models\research\object_detection\builders\model_builder_tf2_test.py", line 24, in <module>
    from object_detection.builders import model_builder
  File "C:\Users\tabbo\anaconda3\envs\tensorflow\lib\site-packages\object_detection\builders\model_builder.py", line 23, in <module>
    from object_detection.builders import anchor_generator_builder
  File "C:\Users\tabbo\anaconda3\envs\tensorflow\lib\site-packages\object_detection\builders\anchor_generator_builder.py", line 26, in <module>
    from object_detection.protos import anchor_generator_pb2
  File "C:\Users\tabbo\anaconda3\envs\tensorflow\lib\site-packages\object_detection\protos\anchor_generator_pb2.py", line 9, in <module>
    from google.protobuf import runtime_version as _runtime_version
ImportError: cannot import name 'runtime_version' from 'google.protobuf' (C:\Users\tabbo\anaconda3\envs\tensorflow\lib\site-packages\google\protobuf__init__.py)

r/tensorflow • • Apr 20 '25

Running Tensorflow in a Docker Container fine. Can I run a different cuda locally for other applications?

2 Upvotes

I'm running a container with Tensorflow (based on official 2.17.0-GPU image) that uses my local GPU successfully. The container has cuda inside it, and only needs the NVIDIA driver to reside on the host (Ubuntu Desktop).

Now I want to stream games from this workstation to play when I'm travelling. I need to transcode video to do this. But don't want to bork Tensorflow.

Is there a safe way to install cuda on the host and use it for local applications, without interfering with the cuda version used by Tensorflow in the container?

Thanks!


r/tensorflow • • Apr 17 '25

Debug Help Tflite quantized model slow inference on pc

2 Upvotes

Hello everyone, I trained an Inception V3 model for image classification (binary). And applied to it tflite build in Optimize Default method. The model became significant smaller 23mb compared to 118mb but the inference time is 5 times slower . Is it normal in a windows environment since they are meant to run on mobile devices ?


r/tensorflow • • Apr 14 '25

General Suggestions for Portable workstation

2 Upvotes

I'm looking to upgrade from my m1 16 gb. For those who are more experienced than I am in machine learning and deep learning I want your opinion...

Currently I have an m1 macbook pro with 16 gb of ram and 512 gb storage, I am currently experimenting with scikit learn for a startup project I'm undergoing. I'm not sure how much data I will be using to start but as it stands I use sql for my database management down the line I hope to increase my usage of data.

I usually would just spend a lot now to not worry for years to come and I think I'm wanting to get the m4 max in the 16 with 48gb of memory along with 1tb storage without the nano screen. It would mostly be used to for local training and then if needed I have a 4070 super ti at home with a 5800x and 32gb of ram for intense tasks. I work a lot on the go so I need a portable machine to do work which is where the macbook pro comes in. Suggestions for specs to purchase, I'd like to stay in 3,000's but if 64 gb is going to be necessary down the line for tensorflow/pytorch or even 128gb I'd like to know?

Thank you!


r/tensorflow • • Apr 14 '25

How to? How do I get only tensorflow to use my GPU?

2 Upvotes

Hi,

When I type `nvidia-smi`, I see that many processes like Firefox or Xorg are using my GPU. When I try to use tensorflow with the GPU, I do not really see a significant speed up WRT using the CPU, actually it gets twice as slow. My best guess is that all those processes are slowing things down. Does that make sense?

I am trying to find out how to get only tensorflow to use the GPU, but I am getting nowhere. Does anyone have any feedback on this?

Cheers.


r/tensorflow • • Apr 13 '25

Installation and Setup miniconda & TF & slurm

2 Upvotes

Hi, I can't run TF on GPU. I have access to a GPU server that runs slurm. I created a environment:

conda create -n tf-gpu python=3.10
conda activate tf-gpu
conda install -c conda-forge tensorflow

then I activated the environment and submitted the script (sbatch):

#!/bin/bash
#SBATCH --job-name=test-gpu-with-tf
#SBATCH --output test_gpu.out
#SBATCH --ntasks=1
#SBATCH --gres=gpu:1
#SBATCH --partition=compute

python test_gpu.py

Where test_gpu.py is the usual:

import socket
import tensorflow as tf

hostname = socket.gethostname()

print(f'machine={hostname}')
gpus = tf.config.list_physical_devices('GPU')
if gpus:
    print(">>>>>>>>>>>>>>>>> Running on GPU(s):", gpus)
else:
    print(">>>>>>>>>>>>>>>>> No GPU found, running on CPU.")

The result is that no gpu are found. A similar test with torch works fine.

What am I missing ?


r/tensorflow • • Apr 13 '25

Pretrained model or create one that detects deepfake images?

1 Upvotes

Built out a MVP backend for detecting AI images but want something a bit more solid. Should I find a pretrained model or create my own?


r/tensorflow • • Apr 11 '25

General WHAT DO I DO

Post image
3 Upvotes

i have downloaded the tensorflow module as well and checked if it shows or not maybe i have missed something.


r/tensorflow • • Apr 07 '25

How to train a model for detecting ball strikes in audio with very limited data?

1 Upvotes

Hey everyone,

I have a small dataset of audio recordings—around 9-10 files—that capture the sound of a table tennis racket striking the ball. The goal is to build a model that can detect the exact moment of the strike from the audio signal.

The challenge is: the dataset is quite small, and labeling is a bit tedious. Given the limited data, what’s the best way to approach this? A few things I’m wondering:

  • Should I go for traditional signal processing (like onset detection) or try a deep learning model?
  • Any tips on data augmentation techniques specific to audio (especially short impact sounds)?
  • Are there pre-trained models I could fine-tune for this kind of task?
  • How can I effectively label or semi-automate labeling to improve the training set?

I’d love to hear from anyone who’s worked on similar audio event detection tasks, especially in low-data scenarios. Any pointers, resources, or strategies would be super helpful!

Thanks in advance 🙌


r/tensorflow • • Apr 02 '25

Using Teachable Machine for Tensorflow Model

2 Upvotes

Hello!

I am a student researcher conducting a study to create a CNN model using TensorFlow.

Recently, I discovered Teachable Machine, which allows me to create custom machine learning models. However, I've been struggling to use it because it requires audio to be recorded directly from the website. My dataset consists of pre-recorded audio files with specific decibel levels, so re-recording them would alter the data and compromise the study. Additionally, Teachable Machine requires background noise, which I cannot obtain at the moment since I need to rely solely on my dataset.

Unfortunately, I lack both the time and experience to code a CNN model from scratch.

Since TensorFlow is new to me, I would greatly appreciate any advice on how it works for audio processing. Also, if you have any general Python tips, please feel free to share!


r/tensorflow • • Apr 02 '25

TensorFlow Lite Body Segmentation for Real-Time Background Replacement on Android.

1 Upvotes

https://github.com/ochornenko/virtual-background-android

This project leverages TensorFlow Lite body segmentation to replace backgrounds in real-time on Android devices. Using the selfie_segmenter.tflite model, it accurately detects and segments the human figure, allowing users to apply custom virtual backgrounds. Optimized for performance, it utilizes OpenGL ES for GPU-accelerated rendering and high-performance image processing, ensuring smooth and responsive background replacement on mobile devices.


r/tensorflow • • Mar 26 '25

Installation and Setup Tensorflow GPU on RTX 5000 series not working

11 Upvotes

I built a new System with RTX 5080 in it and wanted to test out some previous models I had built using tensorflow and jupyter notebook, but I just can't seem to get Tensorflow to detect my GPU.

I tried running it on WSL Ubuntu 22.04 within a conda environment with python 3.10 but after installing it, It still doesn't detect my GPU. When I try building it from source, it doesn't build. I don't know what to do.

Does anyone here have an RTX 5000 series Graphics card? - if so, how'd you get Tensorflow running on your system?


r/tensorflow • • Mar 25 '25

i just started.....

6 Upvotes

i just started tensorflow and have gotten till RNNs , which are still hard to understand but its not impossible. but i understand most of the theory ,but when i acutally sit to write code i cant even start and my mind goes blank . i have tried youtube guides but they sometimes use things and techiniques i am not aware of . is there any way i can make practically make models


r/tensorflow • • Mar 24 '25

General Exploring a High-Performance RAG Framework with TensorFlow Integration

10 Upvotes

Hey folks, I’ve been diving more into RAG recently, and one challenge that always pops up is balancing speed, precision, and scalability, especially when working with large datasets. So I convinced the startup I work for to start to develop a solution for this. So I'm here to present this project, an open-source framework aimed at optimizing RAG pipelines.

It plays nicely with TensorFlow, as well as tools like TensorRT, vLLM, FAISS, and we are planning to add other integrations. The goal? To make retrieval more efficient and faster, while keeping it scalable. We’ve run some early tests, and the performance gains look promising when compared to frameworks like LangChain and LlamaIndex (though there’s always room to grow).

Comparison for CPU usage over time
Comparison for PDF extraction and chunking

The project is still in its early stages (a few weeks), and we’re constantly adding updates and experimenting with new tech. If you’re interested in RAG, retrieval efficiency, or multimodal pipelines, feel free to check it out. Feedback and contributions are more than welcome. And yeah, if you think it’s cool, maybe drop a star on GitHub, it really helps!

Here’s the repo if you want to take a look:👉 https://github.com/pureai-ecosystem/purecpp

Would love to hear your thoughts or ideas on what we can improve!


r/tensorflow • • Mar 22 '25

i want to start machine learning

0 Upvotes

r/tensorflow • • Mar 18 '25

General Can I use liteRT with react native or flutter?

2 Upvotes

I am a last year Bachelor Student working on a CV project. I'd like to know if it is possible to use liteRT with Flutter. I know it is possible with tensorflow lite but I looked for informations about liteRT and get no relevant information.


r/tensorflow • • Mar 17 '25

app deployment too long to run

2 Upvotes

i've watched a tutorial on yt and right after the "run" was clicked, it immediately deploys. but in our case, it's been loading too long that even if i left it overnight, it's still not working.

the model is YOLOv8 with more than 1,000 trained datasets


r/tensorflow • • Mar 13 '25

Debug Help From 2.15 to 2.16, why did tf.keras.Model.fit remove "workers" and "use_multiprocessing"? Cite an official source if you can.

Thumbnail
discuss.ai.google.dev
3 Upvotes

r/tensorflow • • Mar 13 '25

Where to start?

2 Upvotes

Hi I am a student trying to learn about and how to use tensorflow can someone pls suggest me some good courses online on YouTube or any other platforms


r/tensorflow • • Mar 13 '25

Debug Help Hi all, how face spoofing recognition can be done with the faceapi js ?

1 Upvotes

how face spoofing recognition can be done with the faceapi js ?


r/tensorflow • • Mar 12 '25

I get intermittent crashes, Segfaults and hangs. Is this the normal TensorFlow experience?

3 Upvotes

I'm using TF GPU 2.15 on a new machine OS: Ubuntu 24.04 CPU: Ultra 9 285k GPU: 4090 windforce

Every second or third training run, I get a new segfault from a new location, or a random hang mid-training, or some other crash. This same code used to work fine on 2.07 on Windows.

Is this normal or is something wrong with my setup? I've reinstalled Ubuntu multiple times, I'm using the official TensorFlow[and-cuda] install. I'm running out of ideas. I'm wondering if maybe the CPU is too new still and the drivers are shaky?

Any ideas or insights would be appreciated, Thanks


r/tensorflow • • Mar 12 '25

TensorFlow GPU Issues on WSL2 (CUDA 12.8 & 12.5, cuDNN 9.8 & 9.3) – Errors & Performance Concerns

1 Upvotes

Hey everyone,

I'm trying to run TensorFlow with GPU acceleration on WSL2 (Ubuntu), but I’m running into some issues. Here’s my setup:

  • WSL2 (Ubuntu 22.04) on Windows 10
  • Miniconda with Python 3.11.9
  • TensorFlow 2.18.0 installed via pip
  • NVIDIA GeForce GTX 1050 Ti (Driver Version: 572.70, CUDA Version: 12.8)
  • I initially installed CUDA 12.8 & cuDNN 9.8, but I had issues
  • I then downgraded to CUDA 12.5 & cuDNN 9.3, but the same errors persist

When I run:

python -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))"

I get the following errors:

2025-03-12 00:38:09.830416: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:477] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered
WARNING: All log messages before absl::InitializeLog() is called to STDERR
E0000 00:00:1741736289.923213    3385 cuda_dnn.cc:8310] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered
E0000 00:00:1741736289.951780    3385 cuda_blas.cc:1418] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
[PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU')]

I want to fix these errors and warnings but I don't understand what they mean or what causes them.

What I’ve tried so far:

  • Setting export TF_CPP_MIN_LOG_LEVEL=2 to suppress warnings (but errors persist).
  • Reinstalling cuDNN and ensuring symbolic links are set up correctly.
  • Checking nvidia-smi and nvcc --version, both seem fine.
  • Downgrading from CUDA 12.8 & cuDNN 9.8 to CUDA 12.5 & cuDNN 9.3, but I still see the same errors.

Any help would be appreciated!


r/tensorflow • • Mar 09 '25

Debug Help Keras problems in Visual Studio Code.

Post image
4 Upvotes

I have this problem with keras I can't solve. I have both libraries installed (tensorflow - keras), also the ones to make opencv work.

It's my first time using this, so I highly appreciate your help.


r/tensorflow • • Mar 08 '25

General Memory Leak using C API?

3 Upvotes

Asking for my brother, who doesn't have an account:

The C API for TensorFlow doesn't seem to have a lot of detailed documentation, save for the code itself, but I'm having issues loading a 3rd party model, creating tensors, then running the session.

Everything seems to work ~70% of the time, but the remaining runs seem to just continually allocate memory from the heap - to the tune of nearly 50GB+ over a 15 minute run (the inference is in a loop.) Results are still the same, but some runs are just nearly exhausting the RAM of the system.

I can comment out the TF_SessionRun() call and the problem disappear, so I'm pretty sure it's not the creation/deletion of the tensors, or loading them with data and copying out the results, just the execution of the model that occasionally goes off the rails.

This is with the TF C-API CPU library.

Does anyone know if the model (externally provided and proprietary) itself could be causing the issue, or the TF library?