82,703 questions
0
votes
1
answer
44
views
TensorFlow 2.18 not detecting GPU with CUDA 12.8 & cuDNN 9.8.0 (Torch works fine)
I am trying to set up TensorFlow 2.18 with GPU support on my system. However, TensorFlow is only detecting the CPU and not the GPU. Meanwhile, PyTorch is able to detect and utilize the GPU without any ...
-1
votes
0
answers
22
views
Using TensorFlow.js to Correct Sentences Based on Training Data
I'm working on a Node.js project that uses TensorFlow.js to correct sentences based on a training dataset. The dataset consists of example sentences, and I want the machine learning model to learn ...
0
votes
0
answers
23
views
MobileNetV3-Large TFLite Model Works in Notebook But Always Predicts the Same Class in Flutter App
I trained a 46-class image classification model using MobileNetV3-Large with TensorFlow/Keras and saved it as a .keras model. I converted it to TFLite using tf.lite.TFLiteConverter.from_keras_model()
...
-1
votes
0
answers
22
views
loss become nan after step 120
I built a simple model to verify that my AMD GPU is working properly with the drivers. For this purpose, I constructed a simple model with randomly generated data each time. However, the loss becomes ...
-4
votes
0
answers
22
views
Tensorflow integration with system gpu
`i had successfully connected my gpu with tensorflow,(installed numpy 1.23.0 to solve numpy 2.x error) but when i try to import sklearn,it shows error like-"ImportError: numpy._core.multiarray ...
0
votes
0
answers
16
views
CycleGAN Training Log: Constant Adversarial Loss & Discriminator Accuracy Stabilization at ~49%
Issue Description:
I am running CycleGAN training using Keras v3.8.0 and have observed the following behavior during the initial epoch (0/200):
Discriminator (D):
The D loss starts around 0.70 (e.g., ...
0
votes
0
answers
17
views
InvalidArgumentError with tf.data.Dataset.from_generator() at random points during training
I want to use a python generator with a tf Dataset to extract and preprocess sequences from a (rather large) numpy array, but I keep getting this error at random points during the first epoch of ...
0
votes
0
answers
9
views
TAO Command Not found, whenever trying to run nvidia model inside TAO TOOLKIT TENSORFLOW docker container on WSL2
Hello even though I am inside the TAO toolkit tensorflow I am still having the issue of decrypting a model with tao
docker run -it --rm -v /home/models:/workspace/model_dir -p 8888:8888 --runtime=...
-1
votes
0
answers
29
views
Tensorflow Lite Linux app outside of main repo
I want to build a tensorflow lite program that runs on an arm64 embedded linux device.
I can build and run the c++ examples from the main repo just fine, but I would like not to keep the whole repo ...
0
votes
0
answers
22
views
Android mediapipe second inference instance can't be initialized
I do some experiments with google.mediapipe framework and observing next issue... if some instance/task was initialized, it's impossible to create another instance of inference task after.
For example,...
-1
votes
1
answer
33
views
ImageDataGenerator is throwing Invalid Argument Error
I am working on an Image classification problem with ImageDataGenerator from the keras library. Here is what my script looks like
datagen = ImageDataGenerator(rescale=1./255, validation_split=0.2)
...
1
vote
0
answers
50
views
Warning when loading the model because of Adam optimizer
I am implementing the following multi-task model with the following layers:
@tf.keras.utils.register_keras_serializable()
class Bcb_block(Layer):
def __init__(self, mid_chan, out_chan, data_format ...
-1
votes
0
answers
13
views
Implementing GRADCAM on a Keras Based Classifier
In my implementation of GRADCAM, I have two very similar classifiers to classify the MNIST dataset.
input_layer = Input(shape=(28, 28, 1))
x = input_layer
for filters in [32, 64, 128]:
x = Conv2D(...
0
votes
0
answers
18
views
alternating epochs are resulting into all 0 results , loss and accuracy all zero results [closed]
while i am running my training loop i am getting a valid accuracy on one epoch but on every alternate epoch i am getting all 0 results my loss and accuracy all the results are 0
I was trying to train ...
-1
votes
0
answers
30
views
how tensorflow actually treat large/small logits [closed]
In the most binary classfication, we compute cross entropy as following
loss = y*log(p) + (1-y)log(1-p)
where p = 1/(1+exp(-logit))
And we all know when p->1 or p->0, loss actually explodes and ...
-4
votes
0
answers
32
views
High Test accuracy value but bad at prediction [closed]
import tensorflow as tf
from tensorflow.keras.preprocessing.image import ImageDataGenerator
from tensorflow.keras.applications import MobileNet
batch_size = 8
num_epochs = 20
num_classes = 4
...
-1
votes
1
answer
16
views
Cannot run ProtNLM from Uniprot with Tensorflow in colab notebook
I am interested in running Uniprot's Protein descriptor model, ProtNLM, to add some bonus descriptors for a big chunk of protein sequence I have.
They have a trial notebook available here.
Here is the ...
0
votes
0
answers
71
views
TypeError: __init__(): incompatible constructor arguments
I have trained a model ssd_mobilenet_v2_fpnlite_320x320_coco17_tpu-8 in tensorflow api but when training the model, I have an error message:
TypeError: __init__(): incompatible constructor arguments. ...
0
votes
0
answers
14
views
Google colab No DNN in stream executor for tensorflow keras with T4 GPu
The code
import tensorflow as tf
import numpy as np
# Check and enable GPU if available
if tf.config.list_physical_devices('GPU'):
print("GPU is available and enabled.")
else:
print(...
0
votes
0
answers
13
views
Tensorflow: Convert Tensor to Tensor3D in TypeScript
I am new in Tensorflow and use the NPM library @tensorflow/tfjs-core.
I want to convert a Tensor-Object to a 3D representation. I had a look into their API documenation, and found that this was ...
-2
votes
0
answers
53
views
Neural networks in R [closed]
I have tried using LSTM for predicting, and I have monthly data for past 15 years, sequence length is 12 months, and I have some questions:
Divide dataset into train, validation and test. Currently I ...
1
vote
0
answers
33
views
How Come Memory Footprint of a Tensorflow Model is Increasing After tflite Conversion?
Trained a simple tensorflow model containing some LSTM and Dense feed-forward layers. After training, I am quantising and converting the model to a tf.lite format for edge deployment. Here is the ...
0
votes
0
answers
23
views
Force TouchDesigner to use a specific python version
I'm running Windows10.
For my project I have to use Python 3.10 with tensorflow-directml, torchvision and other deep learning tools.
The following is a link to one of the many guides about this topic:
...
0
votes
0
answers
62
views
TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType. Huggingface model locally
I'm trying to run a LM locally I don't really have much knowledge of huggingface.
What I did is creating account there then creating a token that can read/write.
I created a project did pip install ...
0
votes
0
answers
12
views
How to load small sample of tensorflow_dataset data
I'm trying to play around with a neural network using the "lm1b" dataset in my computer before training a larger model in a cloud machine.
What I'm struggling with is that every time I try ...
0
votes
0
answers
15
views
Convert text to 32-dimensional vector using albert-v2 weights
Inconsistency problem of text-to-32-dimensional vector data:
Use huggingface to download Albert-v2 weights to the local computer and read the text for inference. Why is the vector of the same text ...
-2
votes
0
answers
33
views
Error install openai whisper - can't install easy_install
When install openai whisper, I am getting an error because I can't import easy_install from setuptools
I have tried using curl to grab it from bootstrap but again won't import.
Does any have a ...
1
vote
2
answers
53
views
Why does my Keras model show 4 parameters instead of 2?
I'm training a simple Keras model with one Dense layer, but when I call model.summary(), it shows 4 parameters instead of 2.
import tensorflow as tf
import numpy as np
# Generate dummy data
X_train = ...
-3
votes
2
answers
32
views
Loss function for Multi-Label Classification of multiple labels and sparse outcomes [closed]
Consider the Multi-Label Classification with ANN where the targeted labels were of the form
[0,0,0,0,0,1,0,1,0,0,0,1]
[0,0,0,1,0,0,0,0,0,0,0,0]
...
There were N labels each of True(1) or False(0) ...
-1
votes
0
answers
15
views
Openpose tensorflow2.0 build does not work on MacOS (pafprocess)
Have been trying to openpose with tensor flow2.0 on MacBook OS15.3 and it is failing when I try to build openpose with pafprocess. Please help:
pafprocess % swig -python -c++ pafprocess.i && ...
1
vote
0
answers
28
views
YOLOv8 Hand Detection Fails at Close Range After TensorFlow.js Conversion
I'm using YOLOv8 for real-time hand detection in a web app. The model works well in Python, but after converting it to TensorFlow.js, detection struggles when the hand is too close to the webcam—...
0
votes
2
answers
30
views
Issues converting Tensorflow model with float64 operations to TFLite
I am looking to compile this model as a TFLite model, but since the model utilises float64 operations I am running into issues with it. I hope someone has some insights here on whether it is at all ...
0
votes
0
answers
14
views
Register Keras neural network weights with GPflow kernel
I am trying to implement a neural kernel function (attentive kernels). The kernel uses a neural network to predict mixture component weights.
Here's my init:
class AttentiveKernel(gpflow.kernels....
0
votes
0
answers
37
views
Error when importing to_categorical from tensorflow.keras.utils
Whenever I use
from tensorflow.keras.utils import to_categorical
or
from tensorflow.keras.datasets import mnist
I receive the error "could not be resolved". Did anything change over the ...
1
vote
0
answers
25
views
MLP with data and physics loss
I have the following problem: Training an MLP on 4 inputs while also having an estimation from a physical model (with some error). I now want to compute a combined loss from the physics and data loss ...
0
votes
0
answers
29
views
Select TensorFlow op(s), included in the given model, is(are) not supported by this interpreter. when trying load the model in flutter
getting this error while trying to load a tf model I converted to tflite so I can use it in my app
I did what the message suggests and added the org.tensorflow:tensorflow-lite-select-tf-ops dep in the ...
0
votes
0
answers
27
views
None Gradients for a model with 2 outputs
I have a model that has a GRU implementation inside and process audio samples. In each forward path I process a single sample of an audio file. To imitate the GRU behavior correctly, I have returned ...
-1
votes
0
answers
26
views
Implementing custom huggingface pipeline that uses non pytorch/tesnorflow model
this is my very first post on stackoverflow. I have used it many times but never really asked anything. Now however, I run into an issue that I really cant solve and would really really appreciate ...
1
vote
1
answer
26
views
Tensorflow GradientTape Error "inside its context is signficantly less efficient than calling it outside the context"?
I am currently working on Adversarial Attacks on Image dataset. The most important libraries in my project are :
Tensorflow 2.10.1 (with CUDA) (the error is with tensorflow)
Pytorch 1.13.1+cu116
art (...
-3
votes
0
answers
22
views
How to convert a PyTorch checkpoint to TensorFlow?
Load a trained PyTorch ResNet-50 model from a .pt checkpoint.
Export the model to ONNX format.
Convert the ONNX model to TensorFlow using onnx-tf.
Export the TensorFlow model as a .pb file.
Convert ...
0
votes
0
answers
23
views
How does clusters work in TensorFlow in the parameterServerStrategy?
I don't seem to understand how clusters work in the parameterServerStrategy in TensorFlow, and I need some clarifications.
I have read this tutorial, but they don't mention or explain clearly how to ...
1
vote
1
answer
72
views
numpy eager execution problem after loading a CNN model
I want to save and load a CNN model to further training. I have developed a model and saved it as .h5 file. There is no problem when creating, training, and saving at first run.
The problem exists ...
-1
votes
0
answers
48
views
Unable to use Seq2SeqTrainingArguments of Transformers 4.49.0
I want to use Seq2SeqTrainingArguments and Seq2SeqTrainer. The code was working using old version of transformers 4.28.1.
Here is the minimal executable example:
import transformers
from transformers ...
0
votes
0
answers
35
views
Python multithreading or multiprocessing or something else
So i am in the case where i want to train and predict with few hundred models.
for training it is all fine as tensorflow seem to use all the computing power of the cpu cores.
when predicting i need to ...
0
votes
1
answer
57
views
Tensorflow model training, List to numpy array conversion unevenly changes the shape of data
I am trying to predict LSDC from MRI images. For each study_id there are multiple images. Each study_id represents each patient. I want to predict 3 level of severity for 5 conditions on 5 levels.
I ...
-5
votes
0
answers
49
views
Cannot see the GPU when using Tensorflow
GPU: Nvidia GeForce RTX 4070 Laptop
CUDA: version 11.8
Cudnn: present
Cuda is present in the env variables path
Python: 3.10
Tensorflow: version 2.18.0
Working with poetry, however installed with pip
...
0
votes
0
answers
20
views
Tflite Detection Postprocess Explanation
I am trying to replicate the working of TFLITE_DETECTION_POSTPROCESS layer for a custom object detection model.
Does anyone has any reference for TFLITE_DETECTION_POSTPROCESS layer implementation in ...
1
vote
0
answers
25
views
Incorrect header check error when trying to access a tf_record file
I've recently ran into an error when trying to evaluate my training model onto my testing files. The error is thrown at the batch_raw = raw_iter.get_next():
try:
while N_b<max_batches:
...
0
votes
0
answers
73
views
RuntimeError: 'tuple' object has no attribute 'rank'—custom DenseVariational prior/posterior functions are returning a tuple instead of a tensor
I'm encountering a runtime error when building my Bayesian neural network using tfp.layers.DenseVariational layers on QuantConnect. The error occurs during model construction and states:
pgsql
Copy
...
0
votes
0
answers
20
views
MobileNet Always Returns 'Safety Pin' as Classification Result
I am developing a React Native application that uses TensorFlow's MobileNet model for image classification. However, regardless of the image provided, the classification result always returns "...