All Questions
384 questions
0
votes
1
answer
46
views
How To Choose Values From Tensor Using Another Tensor In Tensorflow
I have 2 arrays (Tensors) with the same shape such as:
array1 = [[[0, 1, 0], [1, 0, 0]], [[0, 1, 0], [0, 0, 1]]]
array2 = [[[0.2, 0.7, 0.1], [0.2, 0.4, 0.4]], [[0.2, 0.8, 0.0], [0.5, 0.2, 0.3]]]
I ...
0
votes
0
answers
1k
views
TensorFlow Lite Model Compatibility Issues with Feedback Manager and oneDNN Custom Operations
for the Python code given below. I am getting this error. Please, anyone, help me with this.
2024-07-15 17:11:36.038742: I tensorflow/core/util/port.cc:153] oneDNN custom operations are on. You may ...
0
votes
0
answers
576
views
Error: missing attribute 'value' LLVM ERROR: Failed to infer result type(s). occuring while trying to convert .h5 file to .tflite file
I had trained a mobilenet model and exported the model into a .h5 file after training. I need to convert it into a .tflite file to use it in a mobile application, but I am not able to convert it as I ...
1
vote
1
answer
68
views
3D cropping inside a TensorFlow/Keras model
I'm trying to create a model that performs 3D cropping on an input tensor based on given bounding box coordinates, however, I keep receiving the following error message:
TypeError: Exception ...
6
votes
2
answers
9k
views
Why do I get ValueError: Unrecognized data type: x=[...] (of type <class 'list'>) with model.fit() in TensorFlow?
I tried to run the code below, taken from CS50's AI course:
import csv
import tensorflow as tf
from sklearn.model_selection import train_test_split
# Read data in from file
with open("banknotes....
1
vote
0
answers
173
views
Problems with using the most recent version if Tensorflow
I've been wanting to give tensorflow a shot for designing a chatbot. However, guides i've seen feel like they were all using an older version of Tensorflow because the one i'm using is the most recent ...
0
votes
0
answers
150
views
tf.contrib.slim , AttributeError: module 'tensorflow' has no attribute 'contrib'
Code Snippet:
import functools
import tensorflow as tf
from object_detection.core import box_predictor
from object_detection.utils import static_shape
slim = tf.contrib.slim
Error Message:
Traceback (...
0
votes
1
answer
97
views
Unable to import tensorflow with error "No module named 'tensorflow.python.distribute.load_context'"
I'm trying to import tensorflow with the following command :
import tensorflow as tf
However, I keep getting the following error message :
-------------------------------------------------------------...
0
votes
1
answer
582
views
How to efficiently compute the Hessian matrix of a Deep Neural Network?
I am using TF2.11.
In order to have a deeper understanding of PINNs, I want to compute the Hessian matrix of the loss wrt to my PINN parameters. My toy case is a 2D Poisson equation
$\Delta u = f$
I ...
0
votes
1
answer
87
views
NaN gradients in TensorFlow
I am trying to learn an arbitrary 1D function using neural networks in TensorFlow. Here is my approach so far:
I have a set of fundamental functions, and I want to be able to express any function in ...
0
votes
1
answer
73
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,
...
1
vote
1
answer
1k
views
Tensorflow ImageDataGenerator for CNN returns "TypeError: Cannot interpret 'tf.float32' as a data type" when looking at data
I am trying to make a CNN and everything was fine until I got to model.fit(...) when I got the TypeError in the title that I haven't seen before. I cast the dtype as a tf.float32 in my ...
-3
votes
1
answer
65
views
What the difference between tf.convert_to_tensor(np.sin(x)) and tf.math.sin(x)?
Bad english, tried my best
I want to plot derivative of function (for example SIN(x), yeah i know that it is cos but only for example) with the following code
x = np.linspace(-5, 5, 100)
tensor_x = tf....
2
votes
2
answers
99
views
In Tensorflow's Conv2D layer, is there a way to reuse the same kernel for all channels of the input?
#input.shape = (N, H, W, C)
H = input.shape[1]
W = input.shape[2]
x_input = tf.keras.Input(shape=input.shape, name="base_input")
x_conv = tf.keras.layers.Conv2D(5, (H,W), activation='relu', ...
0
votes
1
answer
209
views
how to ensure tensorflow gpu version is in use with docker image?
I am using tensorflow 2.13 with help of docker file available within tensorflow models/research/object_detection/dockerfiles folder.
The Docker file contents are
FROM tensorflow/tensorflow:latest-gpu
...