Questions tagged [tensorflow]

TensorFlow is an open-source library and API designed for deep learning, written and maintained by Google. Use this tag with a language-specific tag ([python], [c++], [javascript], [r], etc.) for questions about using the API to solve machine learning problems. The programming languages that can be used with TensorFlow API vary, so you must specify the programming language. Please specify the application area such as [object-detection] as well.

Filter by
Sorted by
Tagged with
0 votes
0 answers
8 views

My OpenCV feed is lagging and I want to make it smoother

I'm making my research project and an amateur at tensorflow and OpenCV, I am trying to make a sign-language translator with real-time text-to-speech feature. I made the others work, but my OpenCV cam ...
Zendrix's user avatar
0 votes
0 answers
13 views

Tensorflow outputs nan for basic object detection/classification

I am receiving nan as my accuracy and loss outputs after each epoch for basic object detection in tensorflow. Also, my results (classification and bounding box coords) are nan. Link to my code and ...
Clouseau's user avatar
0 votes
0 answers
18 views

How to implement Grad Cam on custom model in tensorflow, Graph disconnected error

Hello I created a model through transfer learning, the model is an image classifier that classifies between 2 classes (celeba and uc_merced land use) and outputs a logit I tried to apply grad cam as ...
konst's user avatar
  • 1
-1 votes
1 answer
18 views

Classification Deep learning problem - my model learn to predict a 0.5 value always [closed]

I have a classification problem for the prediction of the market position (up or down). I am using a historical data of an asset with a lot of additional features (130). I am trying using a deep ...
Alessio Bolpagni's user avatar
0 votes
0 answers
9 views

Reading AudioSet data I not all record seems to be present

I am reading data from AudioSet dataset and I find less record than there are supposed to be. The data are save as TFrecord. To read the Audioset tfrecord and select a thunder sound (label= 287) I ...
Giacomo Labbri's user avatar
0 votes
0 answers
16 views

RuntimeError: Input type (float) and bias type (c10::Half) should be the same

I know this error occurs when my model is training with GPU and I'm testing with CPU but I don't know how to fix it. Hope anyone can fix it to me. Thanks. Here is some codes related this issue: if ...
Trung Thanh's user avatar
0 votes
0 answers
15 views

ValueError: Input 0 of layer "sequential" is incompatible with the layer: expected shape=(None, 376, 257, 1), found shape=(376, 257, 1)

I have 799 spectrograms: and 799 labels: and I want to create a tensorflow dataset from them. I tried this : but when i start training i get this error: epochs=10 initial_history=model.fit(...
Santa Bot's user avatar
-1 votes
1 answer
45 views

Best practice for loading test data in separate python files for model training and evaluation: should I train_test_split again or load test data?

Let's suppose I have a train.py file containing the logic for training a model and then saving its parameters into a directory called weights/: x_train, x_test, y_train, y_test = train_test_split(x, y)...
tail's user avatar
  • 357
-1 votes
0 answers
26 views

Getting very less accuracy in vision transformer

Can anyone tell me what's wrong in my code, I am getting very less accuracy in vision transformer, I have at least of 600 samples of all 6 classes, I even used data augmentation as well. I am sharing ...
Akash Kumar's user avatar
1 vote
0 answers
25 views

TFlite Object Detection Model Not Outputting Correct Shape

OS Platform and Distribution (e.g., Linux Ubuntu 16.04): WSL Linux Ubuntu 20.04 (although I've also tried on Linux Ubuntu 22.04) TensorFlow installation (pip package or built from source): Pip package ...
jansdhillon's user avatar
0 votes
0 answers
9 views

Import Error for segmentation_models_3d as sm (TF version: 2.12.0)

I have TensorFlow version 2.12.0 and since Keras has been now a part of tensor flow, I am not installing Keras explicitly. The pip install command is running pretty well but on importing the ...
Dhruv Shah's user avatar
-1 votes
0 answers
37 views

How can I enable GPU device in Jupyter Notebook under Windows 11 [closed]

I have everything up to date, including my OS (Windows 11), Python 3.11.5 , further I've bought GPU for 600$ and still/even though I cannot install tensorflow-gpu. physical_devices = tf.config....
user105898's user avatar
0 votes
0 answers
22 views

Combine two different shaped inputs in Tensorflow, combine images and landmark coordinates

I am currently getting frustrated trying to combine two different shapes input layers that I want to give my model as input. What I have: I have the following two inputs X_train # shape (120, 224, 224,...
Alexander's user avatar
0 votes
0 answers
26 views

Customizing keraslayer for transfer learning wrt tensorflow pretrained models

I am new to AI/ML and wanted to seek guidance as I am totally lost. I will simplify my issue as follows: Let's say I would like to detect apples and oranges in images. I would like to leverage a pre-...
Doug's user avatar
  • 133
0 votes
0 answers
10 views

Use DataLoader Tensorflow for a large pickle size

I have pickle 2 pickle for trainSet and testSet such as data.plk , lables.plk for example for train data pickle have size 2GB. I want to use this pickle file for fit model and get error OOM (out of ...
Amir Ahmadi's user avatar
1 vote
0 answers
42 views

Real-time Hand Recognition fail on 99% Accuracy CNN model

I have trained a simple CNN model on a hand gesture recognition dataset from kaggle. The testing accuracy of my CNN model was great even after 3 epochs (99%). Then, I have tried to build a real-time ...
Sarah Fraihat's user avatar
0 votes
0 answers
6 views

Getting TensorFlow to use double precision for custom classes

Consider the following TensorFlow code, which does not use Keras. I would like TensorFlow to perform the calculations in double precision. For the function tfmult I was able to figure out how to pass ...
NNN's user avatar
  • 719
0 votes
0 answers
9 views

Training with Tensorflow without a fixed batch size

Basically I am using video's as data to train my model. The amount of frames per video is not fixed thus the X in model.fit doesn't work as it doesn't have a shape which can be made a numpy array. How ...
aronb's user avatar
  • 41
0 votes
0 answers
8 views

Nan values returned for y_pred when run on gpu

I have a model which i have tried training on the gpu on my laptop and cpu on a seperate computer. On both, it runs fine and returns values for the loss. When i run it on a gpu on the computer (where ...
Eeerog's user avatar
  • 1
0 votes
1 answer
23 views

Save keras model and StandartScaller to TensorflowJS

I have the following model that I want to save in tensorflowjs format for later use in nodejs. X = df.drop(columns=['Age']) y = df['Age'] X_train, X_test, y_train, y_test = train_test_split(X, y, ...
Ted Mosby's user avatar
0 votes
1 answer
61 views

Tensorflow 2, Serve prediction issue in cpp

I'm trying to use my final saved_model.pb in cpp to send a text as input and receive predicted class id and score. But I get this error: W tensorflow/core/framework/op_kernel.cc:1767] OP_REQUIRES ...
Sina KH's user avatar
  • 565
0 votes
2 answers
42 views

How to set sample weights in torch loss functions?

i know that torch.nn.CrossEntropyLoss(weight=?) the parameter "weight" is meant to balance the unbalance between samples from different classes, its the parameter for classes, and it has the ...
豆宝别出bug了's user avatar
0 votes
0 answers
25 views

tensorflow how to feed many input images (array of (batchsize, height, width, channels)) to tensorflow Conv2d for object detection?

I am having some difficulty feeding training imagery into a Conv2d model (for object detection). My questions are: How do I properly feed a Conv2d model training images? For object detection, how do ...
Clouseau's user avatar
-2 votes
0 answers
30 views

Error "Import Error:No module named 'numpy._utils' windows

I was working normally with numby and then install tensorflow for lstm and I ran the code NEXT day I found this error. I tried to install numpy-utils from pip and still having the same ERROR ----------...
Tom thmous's user avatar
0 votes
0 answers
11 views

Tensorflow TF_SessionRun error problem zsh: segmentation fault

I am getting a segmentation fault when I try to run the TF_SessionRun method from this code: std::vector<float> NeuralNetwork::predict(const std::vector<float> &inputs) { // ...
Kjobber's user avatar
  • 184
0 votes
1 answer
28 views

Why is the behavior different between this Tensorflow and PyTorch LSTM?

I have a very simple Pytorch LSTM I was trying to run on a finance dataset. I have used the form of it before and it has not let me down until now. The LSTM in PyTorch looks like this class ...
Benjamin van Heerden's user avatar
0 votes
0 answers
15 views

Compatibility Issue with TensorFlow 1.15.5 and SHAP Library: Seeking Guidance

I am writing to seek assistance with a compatibility issue I am facing while using TensorFlow 1.15.5 in conjunction with the SHAP library. Here is a portion of the code where the problem occurs, as it ...
nann's user avatar
  • 1
0 votes
0 answers
15 views

Keras model with several inputs does not see data on the one of inputs

architecture: hiden_dim = 2 num_classes = 10 #ENCODER__________ data_input = Input(shape=(28, 28, 1)) encoder_label_input = Input(shape=(num_classes,)) x = Conv2D(32, (3, 3), padding='same')(...
Михаил Черных's user avatar
0 votes
0 answers
7 views

How to access images from tensorflow dataset?

I have created an image dataset in tensorflow, but now I want to use an image from the dataset as a variable (to view and manipulate it, etc) and I simply do not know how to access it, since batch ...
tcb93's user avatar
  • 101
0 votes
0 answers
10 views

running tensorflow on a docker in arm1 mac

For some package reasons i need to run FROM --platform=linux/amd64 ubuntu:20.04 as it seems arm1 mac now support docker on amd64, everything works fine. I can successfully install all my python ...
FrankyBravo's user avatar
0 votes
1 answer
34 views

Add new layer error message: The added layer must be an instance of class Layer

I tried add a new layer to my model but I got the error message TypeError: The added layer must be an instance of class Layer. Found: <class '__main__.New_Layer'> Almost answer say that all ...
Pepeeeee's user avatar
0 votes
0 answers
16 views

Deep Reinforced Learning on Raspberry pi

I am trying to run a deep reinforced problem on raspberry pi 4.The code successfully runs on colab but shows following error.Can any on help me to get this code running on raspberry pi4.Thanks in ...
Sk D's user avatar
  • 1
0 votes
0 answers
18 views

Resize tensorflow image from tensorflow_datasets

I have modified the original tfds code of the CUB dataset link, as I am adding a text description to each of the images. My own version of the CUB dataset builds without problems, but my problem is ...
user1571823's user avatar
0 votes
0 answers
9 views

tf.py_function() doesn't work with pandas

I admit I'm pretty new to the tf environment but I can't wrap my head around this issue, not even reading the documentation. I am trying to read images and labels from a custom dataset, and I created ...
Jacopo Altieri's user avatar
0 votes
1 answer
14 views

Greenlet installation fails with `OSError`

I try to install the optuna package into a TensorFlow tensorflow:2.11.1-gpu image. However, it failed with ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: '/...
emil's user avatar
  • 302
-2 votes
0 answers
12 views

How to output dense layer in Keras? [duplicate]

I am training a neural network using the following Keras code: n_classes = 106 input_layer = Input(shape=(n_classes,)) #I want to output this layer dense_layer = Dense(80, activation='softmax')(...
ardito.bryan's user avatar
-2 votes
0 answers
29 views

U-Net model output's gray noise

I trained this model and it only outputs this weird gray noise. The graph is the loss over epoch graph and the other two images are the expected output and give output. I'm training a model to take ...
Max's user avatar
  • 1
-1 votes
0 answers
21 views

Keras - Received a label value of 99 which is outside the valid range of [0, 50)

I am training a neural network using Keras: input_layer = Input(shape=(n_inputs,)) dense_layer = Dense(80, activation='softmax')(input_layer) output_layer = Dense(106, activation='softmax')(...
ardito.bryan's user avatar
0 votes
0 answers
25 views

How to get file name in custom layer Keras

How to get current batch file name in custom layer? I tried "filename = generator.filenames" but it return all file name and only for ImageDataGenerator, I'm using custom datagenerator. ...
Pepeeeee's user avatar
0 votes
0 answers
30 views

Tensorflow Object Detection model 320x320 and 640x640 difference

I am working on a project using TensorFlow API to perform object detection implement in Android app. In TF2 Dectection Model Zoo, there are same model with different feed in image size, such as SSD ...
yolopoi's user avatar
0 votes
0 answers
21 views

ValueError: Please initialize `TimeDistributed` layer with a `tf.keras.layers.Layer` instance

I'm trying to train this encoder-decoder lstm network. def keras_encoder_decoder_lstm2(structure , args): n_timesteps, n_features, n_outputs = args.seq_len, args.feature_no, args.pred_len ...
Sadeq Al-Ahdal's user avatar
0 votes
0 answers
24 views

How to set up Tensorflow for C++ development on mac ventura 13.6

I want to set up Tensorflow for my local machine, which I can use for development. This is for C++. I can't find any easy-to-install directives for TensorFlow for C++ on mac. I can't find any brew ...
Kjobber's user avatar
  • 184
0 votes
0 answers
26 views

(Tensorflow, Keras) UnicodeDecode Error shown while defining datasets for Training and Validation. How do I resolve this?

Code: image_size = (180,180) batch_size =1 train_ds = tf.keras.preprocessing.image_dataset_from_directory( 'add', validation_split=0.9, subset= 'training', ...
Anshu_p's user avatar
  • 13
0 votes
0 answers
31 views

Tensorflow GPU installation with NVidia T1200 Laptop GPU

The NVidia driver is correctly installed. $ lspci -nn | grep '\[03' 00:02.0 VGA compatible controller [0300]: Intel Corporation TigerLake-H GT1 [UHD Graphics] [8086:9a60] (rev 01) 01:00.0 VGA ...
Koor.fr's user avatar
  • 55
-4 votes
0 answers
31 views

What model should I use to create some masks? [closed]

I have pictures of oesophagi and I would like to filter out the oesophagi in these. Using OpenCV and a refined revision with Paint, I have already created some masks (see pictures). img1 mask1 img2 ...
vinc2905's user avatar
-1 votes
0 answers
16 views

why my video classification model not training?

i am creating a video classification model using the data of image, text and audio but after I created my data , I tried to train it but the Cnn model showing the below error . # Extract features from ...
SWAMI NATHAN's user avatar
-1 votes
0 answers
30 views

TensorFlow always predict the wrong answer even within training set

I am following this tutorial https://colab.research.google.com/drive/1FzSQQR5ta7UGUNJZVYO8GjvNNSWjes3N Sample of csv file "price","requested","stock_quantity","...
Mahmoud El-Yamani's user avatar
0 votes
0 answers
18 views

How to integrate sentence transformer tflite model to android

I have a tflite version of the hugging face model sentence-transformers/all-MiniLM-L6-v2... But i dont know how to shape the input and output tensor...basically the model gives encoding of a sentence ...
Aniruddh's user avatar
-2 votes
0 answers
29 views

How can I obtain EMNIST dataset .npy, I cannot find it on internet [closed]

import tensorflow as tf import numpy as np from tensorflow.keras.utils import to_categorical from tensorflow.keras.preprocessing.image import ImageDataGenerator # Cargar los datos de entrenamiento y ...
Emmanuel Santiago's user avatar
-1 votes
0 answers
17 views

How to Use the Coral TPU for Chess Analysis

Looking to use my Coral TPU for Chess Analysis Any advise on how to make this happen? Current stockfish Dev's state in their GIT hub pages that you cannot point the engine to utilize the GPU for ...
user132992's user avatar

1
2 3 4 5
1650