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
-2 votes
0 answers
31 views

How to train a ML model for face comparison using tensorflow and use it in java? [closed]

I want to compare two faces, whether both are of same person or not. For this I've used pre-trained model (FaceNet) to get face-embeddings and compare two faces. In order to use FaceNet model, I've ...
Zaryab Ali's user avatar
0 votes
0 answers
9 views

How would I use Keras.backend.function( ) to find the predictions of each training batch?

I'm building a custom metric in Tensorflow, but in order to calculate it, I need the following data extracted at the end of each training batch: The probability predictions of each class The row ...
Cam's user avatar
  • 1
-1 votes
0 answers
18 views

How do I prevent overfitting and get a higher accuracy using tensorflow?

I am doing aspect based sentiment analysis and currently my model when fitting starts with the validation loss and accuracy higher than the training, but then it flips and training performs a lot ...
CIA11's user avatar
  • 49
0 votes
1 answer
31 views

install tensorflow wheel through requirements.txt

I'm working on a project and my processor is old, so I need to install a specific Tensorflow wheel, from here: https://github.com/fo40225/tensorflow-windows-wheel/tree/master/2.9.0/py39/CPU%2BGPU/...
Juan C's user avatar
  • 5,915
0 votes
0 answers
19 views

Preparing image segmentation dataset

I have 224, 224 greyscale images and 224, 224, 6 one hot encoded mask for image segmentation model. I saved the mask into npy file and organised the data as below. data/ ...images/ ......img_1.png .......
Seung's user avatar
  • 803
-2 votes
0 answers
14 views

Trouble implementing a neural network for image classification using TensorFlow

'm currently working on an image classification project using TensorFlow, and I'm facing challenges with the neural network implementation. Despite my efforts, the model doesn't seem to be learning ...
Vansh choudhary's user avatar
0 votes
0 answers
30 views

I use Python 3.12.0, TensorFlow and PyTorch are incompatible with Python 3.12.0, what alternative can I choose?

What is a good alternative to Tensorflow and Python pip install tensorflow ERROR: Could not find a version that satisfies the requirement tensorflow (from versions: none) ERROR: No matching ...
Steven's user avatar
  • 24.6k
0 votes
0 answers
11 views

Creating Two Time-Dependent Array Like Datasets for Keras LSTM Model in R

I am working on a time series forecasting project using a Keras LSTM - CNN model in R, and I need help creating two specific datasets for model training. My data spans from 2007 (week 26) to 2021 (...
toastershock's user avatar
0 votes
0 answers
8 views

CoreML returning Nan for no reasons

I'm having a same problem. I created a simple Transformer Decoder in TensorFlow, and it works well. But If I convert it to a CoreML model, from some point it start do just outputs MLMultiArray filled ...
Seungjun's user avatar
  • 884
0 votes
1 answer
36 views

image_dataset_from_directory can't read png, jpeg file

here is my code colab goes well but vscode doesn't image_dir = "ai/data/toonder_img" batch_size = 32 image_size = (64, 64) train_ds = image_dataset_from_directory( directory=image_dir, ...
kitewatermelon's user avatar
0 votes
0 answers
11 views

Custom Reinforcement Environment and Building Agent H

I'm trying to build a RL environment and an agent, and I'm having some difficulties to understand things. First of all, my problem is to fit 2 curves by some rules. I think I managed to create a ...
Metalel's user avatar
1 vote
0 answers
21 views

Cannot import tensorflow module and libtensorflow.so on linux x86

I have a python code using tensorflow and also calling a C++ dll which need tensorflow dll. The python run fine when I call only import tensorflow as tf, it also run fine when calling tensorflowdll = ...
Nathan's user avatar
  • 21
0 votes
0 answers
55 views

TypeError: __init__() got an unexpected keyword argument 'metaclass'

When I use python 3.9 in pycharm and try to import packages, I get the error. The problem occurs after running to the second line of code: import tensorflow as tf from tensorflow.keras.models import ...
Jrs18's user avatar
  • 1
0 votes
0 answers
24 views

Error in Install TensorFlow GPU on Windows 11

After creating & activated environment, I have installed cudatoolkit, But tensorflow not installing & getting Error: conda activate deep conda install -c conda-forge cudatoolkit cudnn python ...
Ravi M B's user avatar
0 votes
0 answers
12 views

How to access submodel layers encapsulated in Time distributed layer in Keras model

I have developed a model that consists of extracting spatial features from video frames using VGG-19 and, from these spatial features, extracting temporal features using LSTM. For this purpose, I have ...
Pablo N.'s user avatar
0 votes
1 answer
41 views

How to resolve BERT HF Model ValueError: too many values to unpack (expected 2)?

I have a dummy dataset of two text columns and labels as below. import tensorflow as tf from transformers import BertTokenizer, TFAutoModelForSequenceClassification import numpy as np from datasets ...
krishna kaushik's user avatar
0 votes
0 answers
13 views

DNN library is not found

This was asked here How to solve Conv1D DNN library is not found? but the answer does not solve my problem. I am using cuda toolkit 11.2 and cudnn 8.1, but I still get this error. Running in vscode, ...
user13832811's user avatar
0 votes
0 answers
13 views

How to use tensorflow (tflite) model maker with class weights

I am using the tflite model maker for Object Detection and I would really like to apply class weights to my training process to fight class imbalance. I am using the Efficient-Det-Lite model family. ...
finisinfinitatis's user avatar
0 votes
0 answers
15 views

Fine Tuning a T5 Model on Squad

Goal: Fine Tune T5 on SQUAD dataset for extractive question and answer Question: If my tokenized dataset contains input_ids, attention_mask, targets_ids, and target_attention_mask, why is the trainer ...
AlifUnseen's user avatar
-1 votes
0 answers
23 views

Import tensorflow as tf not running

I try to run this code right here (note I am on python 3.9.12): import tensorflow as tf from object_detection.utils import config_util from object_detection.protos import pipeline_pb2 from google....
Jake's user avatar
  • 1
0 votes
0 answers
26 views

Problem with proper cuDNN instalation for tensorflow

I tried making small models with tensorflow, CPU worked for me. But when the training time got substantial, I wanted to switch to GPU-based training. I installed CUDA v11.2, along with cuDNN (v8.1.0, ...
FilipDev_'s user avatar
0 votes
0 answers
15 views

Trying to create profile to profile recommendations in a Django(DRF) project with TFRS (tensorflow recommenders)

I am creating a DRF project, which allows users to register, sign in and interact with each other. In this project, users are allowed multiple profiles, as a way to show different faces of themselves (...
Luca's user avatar
  • 25
0 votes
0 answers
86 views

How to extend Keras GPT2 model (MoE example)

I was playing around with Keras GPT2 model - in an attempt to make a Mixture of Experts and achieve agi. Link to Keras docs: https://keras.io/api/keras_nlp/models/gpt2/ Final Edit Got it to work ...
Edv Beq's user avatar
  • 930
0 votes
1 answer
47 views

Tensorflow ValueError: Input 0 of layer "sequential" is incompatible with the layer: expected shape=(None, 180, 180, 3), found shape=(None, 180, 3)

I want to check how the model i've built predicts the image. Data set consists of a lot of pictures 256x256 RGB. The problem itself arises in model.predict() function (the model is created without a ...
klenoringer's user avatar
0 votes
0 answers
19 views

Getting Logits and Labels mismatch

I'm trying to build a chatbot using the tutorial text The dataset the tutorial uses is no longer available so I did my own with chatgpt. A snippet of the dataset: How was your day? Amazing! Thanks for ...
Spts77's user avatar
  • 1
-1 votes
0 answers
14 views

Neural Network does not train and kernel gets stuck when trying to implement Multiprocessing

The moment I try to implement multiprocessing the kernel gets stuck and the model is not trained even for a single epoch. import os import logging import multiprocessing import tensorflow as tf from ...
Subhadeep Choudhury's user avatar
-3 votes
0 answers
15 views

Too Many Incorrect Bounding boxes [closed]

I'm trying to do tiny face detection here on my custom input images using the code linked below. However, I'm getting the below result, any idea how can I fix it? Do you know if this is the model ...
Aryan's user avatar
  • 422
-1 votes
0 answers
19 views

TensorFLow Lite C++ undefined reference to ~Implementer() [duplicate]

I am trying to run Tensorflow Lite C++ on Raspberry Pi4 as per this tutorial, but I get the following error when compiling from CodeBlocks: /usr/include/c++/10/bits/unique_ptr.h:85: undefined ...
Peter S.'s user avatar
0 votes
0 answers
37 views

Import "tensorflow.compat.v2" could not be resolved

I met the tensorflow.compat.v2 import error as indicated in the title. I installed tensorflow 2.13.1, keras 2.13.1 and Python 3.11.5 on Windows 10 machine. When I was trying to import tensorflow....
Xinyan Yang's user avatar
1 vote
1 answer
31 views

Np.argmax gives wrong index on prediction class

I've written so simple handwritten classifier example. It works great, it has %98 accuracy on test samples. However, when I have given an sample input to it, np.argmax gives wrong index (even the ones ...
darkdragontr's user avatar
0 votes
0 answers
19 views

How to integrate a pretrained tensorflow model into a keras layer if the exact input shape is unknown?

I'm doing something similar to this tensorflow tutorial: transfer_learning_audio. Basically this tutorial uses a pretrained model (YAMNet) in order to extract features (embeddings) and then trains a ...
waykiki's user avatar
  • 924
-1 votes
0 answers
13 views

Shape issue for y_pred for a custom made loss function

I am relatively new to TensorFlow and stackoverflow. I was trying to implement a custom made loss function for solving ODEs in TensorFlow. I am using the method suggested by a relatively old paper ...
saluisto's user avatar
0 votes
0 answers
12 views

Can't import tensorflow_federated

An attribute Error raised when importing tensorflow_federated on colab though I did install it. !pip install --quiet --upgrade tensorflow-federated import tensorflow as tf import tensorflow_federated ...
Abdalrhman Alshakh's user avatar
0 votes
0 answers
11 views

Windows fatal exception: code 0xc0000374 while tunning Keras hyperparameters

I have been trying to tune my hyperparameters using KerasTuner. But at some epoch in the 11th search trial, this error happened: Windows fatal exception: code 0xc0000374 Main thread: Current thread ...
Murilo's user avatar
  • 555
-2 votes
0 answers
12 views

Generative Adversarial Networks (GAN) for generating music [closed]

So, I'm trying to learn things about machine learning. i've tried to make a project with GAN model to generate a music. I'm using tensor_flow and python. I train my model and compiled it, I try to ...
Emirio's user avatar
  • 1
0 votes
0 answers
27 views

ERROR: No matching distribution found for tensorflow==2.5

I am trying to run the tutorial in google colab !pip install tflite-model-maker tensorflow==2.5 Getting the error for cell-2: Collecting tflite-model-maker Downloading tflite_model_maker-0.4.2-py3-...
Sazzad Hissain Khan's user avatar
0 votes
0 answers
11 views

BERT preprocessor to process .xlsx file

I am doing a music artist classification using BERT in Tensor Flow. The goal is that given lyrics, the model should be able to identify the artist. My dataset is organized in a .xlsx file with three ...
Muana Kasongo's user avatar
1 vote
1 answer
35 views

How to build a model and train it with tensorflow keras sub classing

I have written a custom Encoder and Decoder layers that implements the architecture described in the Attention Is All You Need paper. Everything works fine until I trying compiling it, I get one error....
Krishnang K Dalal's user avatar
0 votes
0 answers
21 views

Training a neural network to play Rock Paper Scissors, gets stuck in a single reply

Background: I am trying to teach a neural network to play rock-paper-scissors against 4 different bots, to solve a task for a coding course (freecodecamp.com) Each bot is a pre-determined strategy, ...
Baldomero's user avatar
0 votes
0 answers
27 views

Cannot display graph of my model’s structure with TensorBoard because the graph is empty

I created the following code in an attempt to display a graph of training steps. for epoch in range(EPOCHS): print(f'\nstart of epoch {epoch}') start_time = time.time() for step, ...
Infman's user avatar
  • 1
0 votes
0 answers
15 views

Tensorflow data generator for CNN issue - AttributeError: 'generator' object has no attribute 'repeat'

I try to run the code for NN training on dataset as a generator: epochs=10 history = model.fit( train_set.repeat(epochs), validation_data=val_set.repeat(epochs), epochs=epochs, steps_per_epoch=2500, ...
Andrey Glinsky's user avatar
0 votes
0 answers
20 views

Can't train and sim my tensorflow model with original dataset (tf.data.dataset) but it work after I split it!? Same processing on both?

I build a dataset for trainning 2 heads neural network, first with lstm and the second with simple perceptron. My dataset process in 2 ways to get one version split into train and test set and the ...
Jonathan Roy's user avatar
0 votes
1 answer
29 views

Using a keras generator for streaming training data yields a strange tensor size mismatch error -- tensor flow code is too opaque to debug the issue

I am training a neural network in tensor flow, and because I was running out of memory when training to load my whole training set (input images and "ground truth" images), I am trying to ...
ekofman's user avatar
  • 399
0 votes
0 answers
10 views

selfmade tensorflow .pb file causes cv2.error

Hey im currently trying to run a Onject detection with an "Homemade" model, im using OpenCV 4.8.1 i only had an .pb file and tried to get an .pbxt with cv2.dnn.writeTextGraph('saved_model.pb'...
Melpaca's user avatar
0 votes
0 answers
8 views

how do i split the data,uploaded by directory_iterator

how do I split the dataset uploaded by , fill_mode='nearest',from tensorflow.keras.preprocessing.image import ( DirectoryIterator, ImageDataGenerator ) # Your desired classes desired_classes =...
basit khan's user avatar
0 votes
0 answers
11 views

input tensor 0 is missing TensorMetadata

This article shows how to add meta_data into a tflite model before running in Android. However, it only shows example for Image classification. I am trying to add meta data for Audio classification. ...
Sazzad Hissain Khan's user avatar
0 votes
2 answers
35 views

What is the purpose of 'batch_size' here and how can it be defined for other datasets?

I have been going through this tutorial until these lines: batch_size = 32 img_height = 180 img_width = 180 train_ds = tf.keras.utils.image_dataset_from_directory( data_dir, validation_split=0.2, ...
Noerigarnhy's user avatar
0 votes
0 answers
6 views

Getting error while creating classifier for Urbansound8k .tflite model in Android

I have built model here with urbansound8k dataset. And converted to tflite using following code. Then I was trying to run inference in Android following similar some steps used for simple audio ...
Sazzad Hissain Khan's user avatar
0 votes
0 answers
17 views

Tensorflow: kurtosis of a tensor

Is it possible to calculate the kurtosis of a tensor, instead of tf.reduce_std something like tf.reduce_kurt?
lara_toff's user avatar
  • 412
0 votes
1 answer
9 views

tensorflow DenseHashTable lookup multi-dimensional keys

I want use DenseHashTable lookup string tensors, just like this answeranswer , keys' type is tf.string, value is embedding with tf.float32 dtype. But when keys is multi-dimensional, error occurs. keys ...
Eugene Deng's user avatar

1
2 3 4 5
1653