All Questions
154 questions
1
vote
1
answer
87
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 ...
0
votes
1
answer
112
views
Training a Keras model to identify leap years
I'm trying to teach my learning model how to identify leap years.
My Python code can be seen below:
import tensorflow as tf
import numpy as np
import calendar
# ------------------- UTILITY FUNCTIONS -...
0
votes
0
answers
755
views
Getting Error "object __array__ method not producing an array" while training a model
I am trying to train a model using the neural network model Sequential. Every thing is going good till the model compilation. As soon as i hit model.fit() for model training i get the error "...
0
votes
1
answer
804
views
Plot the SHAP values for LSTM model in Python
I have the following code that is working.
import numpy as np
import shap
from tensorflow import keras
X = np.array([[(1,2,3,3,1),(3,2,1,3,2),(3,2,2,3,3),(2,2,1,1,2),(2,1,1,1,1)],
[(4,5,...
0
votes
1
answer
273
views
Tensorflow Model Predict Returning NAN?
When I run model.predict(##), I get the result nan. I also get this for calculating the loss function. This is what my code looks like:
import tensorflow as tf
import numpy as np
from tensorflow ...
1
vote
1
answer
146
views
Input problem for LSTM-based model. Shape mismatch in tensorflow data
So I'm trying to create a GAN model known as TAnoGAN(Time Series Anomaly Detection GAN). Whose official implementation in PyTorch is available here.
I'm trying to convert it to a Tensorflow ...
0
votes
1
answer
307
views
y should be a 1d array, got an array of shape {} instead.".format(shape)
I am currently working on a project to detect and recognise handwritten signatures. I am able to detect the signatures and store it in a "images" folder and I am storing the labels in a &...
0
votes
0
answers
93
views
Data cardinality is ambguous: Make sure all arrays contain the same number of samples
I am attempting to train a sequential model using Keras, however, I encountered an error when attempting to provide input into the NN. The NN has 2 layers, with 250 hidden nodes.
Specifically, the ...
-1
votes
1
answer
228
views
error when trying to run my tensorflow code
This is a follow up question from my latest post: Put input in a tensorflow neural network
I precoded a neural network using tensorflow with the MNIST dataset, and with the help of @FinnE was able to ...
0
votes
1
answer
321
views
Deep Learning Tensorflow reshape is not working?
I try to get a prediction out of a trained model but i need to reshape it for tensorflow but it gives me this error all the time:
ValueError: in user code:
WARNING:tensorflow:Model was constructed ...
0
votes
1
answer
545
views
Text-based Tensorflow unexpected result of train_function (empty logs)
I'm trying to create a NN model with Tensorflow using a few different text files. My code are as follows
DIRECTORY_URL = "https://raw.githubusercontent.com/ake700/Python/main/Data_Science/...
0
votes
1
answer
115
views
No Hidden Layer Neural Network Doesn't Equal Logistic Regression
In theory, a no-hidden layer neural network should be the same as a logistic regression, however, we collect wildly varied results. What makes this even more bewildering is that the test case is ...
0
votes
1
answer
195
views
How to read multiple 3d images and store them in 4D array using numpy python?
I have used the code below to create an array with the shape of (2, 3, 365, 256, 256) (2, 365, 256, 256) for 3 images however I need my shape to be (2,365, 256, 256, 3) (2, 365, 256, 256) for my model ...
0
votes
1
answer
820
views
Why does image_dataset_from_directory return a different array than loading images normally?
I noticed that the output from TensorFlow's image_dataset_from_directory is different than directly loading images (either by PIL, Keras' load_img, etc.). I set up an experiment: I have a single RGB ...
0
votes
1
answer
49
views
When i train a network with keras, why are the shape of my predictions not accurate?
I'm tensorflow keras to train a model to classify if an image is an a or b. I have 20,000 randomly generated images to use for training (half a, half b).
example of a image
example of b image
First I ...