All Questions
Tagged with reshape tensorflow
149
questions
0
votes
0
answers
89
views
reshape a tensor in firebase cloud functions
Im working on a machine learning project and since I don't know the amount of categories in the dependend variables I don't want to hardcode it. In my project now I have 3 different categories but I ...
0
votes
0
answers
18
views
how to build a vae without reshape error?
I build a VAE following https://blog.tensorflow.org/2019/03/variational-autoencoders-with.html
PROBLEM: I thick the problem is in the decoder when I want to reshape the latent Distribution i face this ...
0
votes
0
answers
13
views
Reshape LSTM Layer Input Tensorformat
I have a table with 4700 rows and 50 columns. The last 3 columns should be predicted.
How do I have to set up my X and my y to be able to enter it in an LSTM layer?
X = (?, ?, ?)
y = (?, ?)
I ...
0
votes
0
answers
16
views
How do I reshape the pythonarrays as input and output for a convolutional neural network in Keras4Delphi properly
I'm working on a Speech2Vec algorithm with 3 neural networks. The first of these networks is for speech recognization. It converts a single FFT window (one dimensional) to 'sound nrs.': 1..1500. So I ...
0
votes
2
answers
252
views
Tensorflow shape error: Asking for input and output shape to match?
I am new to Tensorflow, and I realize there are lots of posts out there about shape issues, but I haven't been able to quite apply their solutions to my problem. So please excuse me if this is a ...
0
votes
1
answer
78
views
`tf.keras.layers.Flatten()` not working for some odd reason
I have the following sample code in Python:
import tensorflow as tf
# Create a tensor of shape (14, 2)
x = tf.constant([[1, 2],
[3, 4],
[5, 6],
[...
0
votes
1
answer
681
views
Resize MNIST dataset from (60000, 28, 28) to (60000, 14, 14)
I found the method of resizing the MNIST training dataset from (60000, 28, 28) to (60000, 14, 14).
This is the code and results:
import tensorflow as tf
import numpy as np
(x_train, y_train), (x_test,...
0
votes
1
answer
3k
views
'BatchDataset' object has no attribute 'shape'
Here is my code:
train_images = tf.keras.utils.image_dataset_from_directory(
'/content/drive/MyDrive/ArabicHandwritten2/train')
train_labels = tf.keras.utils.image_dataset_from_directory(
'/...
0
votes
1
answer
199
views
reshape not require to display mnist images?
If I want to display one image from mnist dataset, I need to reshape it from (1,28,28) to (28,28) using the following code:
import tensorflow as tf
import matplotlib.pyplot as plt
mnist = tf.keras....
0
votes
1
answer
549
views
ValueError: Input 0 of layer "value" is incompatible with the layer: expected min_ndim=2, found ndim=1
I'm new to tensorflow.When I try to modify the model structure, I transform a tensor 'r',whose shape is (None,1) into a one-dimensional tensor with tf.reshape(r,[4,]), and then input it into the dense ...
0
votes
1
answer
101
views
reshape dictionary in python
I have a dictionary with two keys and the shape for each of the two keys is ([612, 41, 41, 1]).
I would like to reshape it in order to have shape ([612, 41, 41, 2]) in order to feed it in the cnn with ...
1
vote
1
answer
192
views
Keras ValueError: Input 0 of layer "sequential_1" is incompatible with the layer: expected shape=(None, 923679, 63), found shape=(None, 63)
I have tried to change my input according to the error posted in the link, yet still receiving the same error.
import tensorflow as tf
from tensorflow import keras
from keras.models import Sequential
...
0
votes
0
answers
416
views
Input to reshape is a tensor with 5242880 values, but the requested shape requires a multiple of 196608
I have the following code portion for a convolutional neural network:
class PixelShuffler(Layer):
def __init__(self, size=(2, 2), data_format=None, **kwargs):
super(PixelShuffler, self)....
1
vote
1
answer
149
views
Convert CNN-LSTM model to 1D-CNN model dimension error - `logits` and `labels` must have the same shape
I have a CNN-LSTM model which I want to convert into a simple CNN model for results comparison. This is the original CNN-LSTM model:
# define model CNN-LSTM
model = Sequential()
...
1
vote
1
answer
131
views
tf.reshape(tensor, [-1]) VS tf.reshape(tensor, -1)
What is the difference between these two?
1- tf.reshape(tensor, [-1])
2- tf.reshape(tensor, -1)
I can not find any difference between these two, but when I use -1 without brackets, an error occurs ...