Skip to main content

All Questions

Tagged with
0 votes
1 answer
47 views

Why does batch() return only one batch?

I'm beginner in image processing. I have two binary classes as subdirectory which total of 496 images and I have an issue with the last batch that has remainder of 13 images. So, instead of tf.dataset ...
CChickii's user avatar
0 votes
1 answer
352 views

TypeError: Binding inputs to tf.function failed, Can not cast input_tensor TensorSpec to TensorSpec

error message: Traceback (most recent call last): File "/home/prakrisht/-------------/detect_from_webcam.py", line 173, in <module> run_inference(detection_model, category_index, ...
Beetran Dahiya's user avatar
1 vote
0 answers
43 views

tf.callbacks.EarlyStopping doesn't work properly when feeding tf.data.dataset objects to the model

I set patience=5 for it to stop training if val_loss doesn't decrease for 5 epochs straight. However, training always stop at the 5th epoch, and the best weights are set to 1st epoch even though ...
Tue Tran's user avatar
0 votes
0 answers
34 views

Tensorflow custom layer accessing value of output tensor from previous layer

So I'd like to create a custom Tensorflow.Keras layer with purpose of returning label name as a text. The previous layer is an argmax that returns integer representing the index of predicted class and ...
Dudede's user avatar
  • 1
0 votes
0 answers
39 views

Accesing python lists inside TensorFlow graph-traceable functions

I'm trying to access a python list inside a function that can be run in eager mode or graph mode as shown below: import tensorflow as tf import numpy as np class SlotGenerator: def __init__(self): ...
Naveen's user avatar
  • 469
1 vote
0 answers
35 views

dataset of tensors shuffled after applying map or model.predict

I am trying to predict a target image from an input image and then display both the input and prediction. For some reason, test_images seems to be reshuffled in the process so I can't get them to line ...
Samuel Kostousov's user avatar
0 votes
0 answers
137 views

i keep getting this error : TypeError: Expected any non-tensor type, but got a tensor instead

i am trying to train mobilevit using this bee dataset from tensorflow and i keep getting this error TypeError: Expected any non-tensor type, but got a tensor instead. this is the code i wrote, ...
inter galactic's user avatar
0 votes
1 answer
162 views

Tensor size does not match batch size

I have used this code below to train an unet model. My dataset at first consisted of 10000 images, shape=(256,256,3), what was working fine. However, ofter enlargening it to 14000 images i encountered ...
Dennis's user avatar
  • 9
0 votes
0 answers
32 views

Multiple issues and errors with tensor flow array / matrix / tensor shape and data manipulation

import tensorflow as tf import numpy as np from tqdm import tqdm from datasets import load_dataset from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense from ...
Dylan Bates's user avatar
1 vote
1 answer
47 views

Get n-th item from multi-dimensional array (python)

I have a tensor of shape (12, 19601, 1000) and I want to just take every n-th element of the second entry, I want a tensor of size (12, 19601 / n, 1000). Is there an efficient way to do this? ...
stone327's user avatar
1 vote
0 answers
92 views

Interpretation of Tensorflow Probability tensor_coercible object

I have a tensorflow model (keras sequential) that ends with a Tensorflow Probability (TFP) mixture layer. My goal is to fit this network with a custom loss function. The unexpected behaviour is the ...
joueswant's user avatar
  • 146
0 votes
0 answers
208 views

ValueError: Attempt to convert a value (class) with an unsupported type (class) to a Tensor

these codes were running flawlessly on tensorflow==2.15, for the purpose of GPU acceleration, I switched to tensorflow-gpu == 2.10.1 with keras 2.10, respectively. and this ValueError raised up on my ...
pepCoder's user avatar
  • 331
-2 votes
1 answer
90 views

InvalidArgumentError: `predictions` contains negative values [closed]

I was trying to run the Tensorflow Audio classification code following the article of tensorflow. When I ran the following python code after finishing all above cells orderly: Code: confusion_mtx = ...
Sazzad Hissain Khan's user avatar
0 votes
1 answer
75 views

Pyhton extract matrices from rank 3 tensor

I have data X_train with shape (19601, 1000, 12) but want to extract the 1000 x 12 matrices and combine/append them into one large matrix. Whenever I try to index through X_train and append the rows ...
stone327's user avatar
-2 votes
1 answer
957 views

Tensorflow : could not a find a version that satisfies the requirement tensorflow

I am try to install tensorflow through pip but it showing error "could not a find a version that satisfies the requirement tensorflow" Python 3.12.0 pip 23.3.1 i tried this cmd: python3 -m ...
shashwat choudhary's user avatar

15 30 50 per page
1
2 3 4 5
42