All Questions
72 questions
0
votes
1
answer
259
views
How to load individual .npz files as samples into a Tensorflow Dataset
I am having a problem with loading the data that make up the dataset. My previous (working) approach was to use a pandas DataFrame, but for larger datasets, the training process gets killed, as the ...
-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....
0
votes
0
answers
2k
views
Unable to convert function return value to a Python type! The signature was () -> handle when importing tensor flow
When i try to import tensorflow using the import command on python I get the error :
File "/usr/local/lib/python3.10/dist-packages/tensorflow/python/framework/dtypes.py", line 38, in <...
0
votes
0
answers
47
views
err obj detect TF2 model: ImportError: No module named numpy
while creating customer object detection I'm facing an issue on make cmd
~/object/models/research/cocoapi/PythonAPI$ make all
python setup.py build_ext --inplace
Traceback (most recent call last):
...
0
votes
1
answer
146
views
Reshape the tabular time series data for LSTM binary classification model
I wanted to prepare data for LSTM binary classification model. I wanted to reshape my data into (num_samples,time_steps,num_features) shape. My training data set has the shape (2487576, 21). Here is ...
0
votes
1
answer
468
views
How to convert a 2D numpy array to an tensorflow array for image prediction
Is there an easy way to convert a 2D numpy array to a tf array for image prediction? Currently I have a greyscale image that I have to import into python using another API which gives me a 2D numpy ...
0
votes
1
answer
154
views
How to iterate a tensorflow.train.Example or train.Feature object to get a python list?
I have a tensorflow.train.Feature object which I need to traverse and make a numpy array out of it.
import tensorflow as tf
int_feature = tf.train.Feature(
int64_list=tf.train.Int64List(value=[1, ...
1
vote
0
answers
138
views
How to calculate the Discrete Fourier Transform Sample Frequencies using Tensorflow?
I'm new to using tensorflow.
I'm building a custom loss function that needs to calculate "Discrete Fourier Transform sample frequencies". I can do this calculation using the python library ...
1
vote
1
answer
2k
views
model.predict throws ValueError: expected shape=(None, 64, 64, 3), found shape=(None, 64, 3)
I modeled the following convolutional neural network (CNN) using tensorflow within a google colab notebook:
import tensorflow as tf
PATCHSIZE = 64
# CNN model
model = tf.keras.models.Sequential([
...
0
votes
1
answer
13k
views
I am getting error like "Input 1 of layer "model_5" is incompatible with the layer: expected shape=(None, 224, 224, 3), found shape=(None, 5)
I am trying to fuse features of two image inputs of shape (299, 299, 3), (224, 224, 3) and am getting shape errors.
Here is my code
from tensorFlow.keras.applications.inception_v3 import ...
1
vote
0
answers
129
views
Tensorflow: How can I add loss based on layer's weights?
I know I can add a value to loss with "add_loss()" in custom layers, but I'm wondering how to do this with layer weights. I'd like to consider layer weights as the loss value.
What I want to ...
3
votes
1
answer
2k
views
Access Tensorflow tensor value
I have a tensor with the following properties. I want to save the numpy = 1 but I don't know how to access this value. How do I do this?
test_labels[1]
<tf.Tensor: shape=(), dtype=int32, numpy=1&...
1
vote
0
answers
243
views
How to concat a list of numpy array to tensorflow 2.0tensor for training
I have a list of numpy arrays, the shape is [1,x, x, 3]. Here, x is different for each array. How to stack them into a minibatch to let keras model output=model(stack_list_array).
For training, the ...
0
votes
1
answer
67
views
Tensorflow - keras - shapes and loss for multilabel classification
X_np_new.shape, y.shape
((50876, 2304), (50876, 9))
Code:
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Dropout, Activation
from tensorflow.keras....
2
votes
1
answer
1k
views
How do I create a tf.Tensor from a pandas DataFrame containing arrays?
I have a pandas DataFrame like below.
import pandas as pd
import numpy as np
import tensorflow as tf # Version 2.8.0
df = pd.DataFrame({"id":
["i123", "...