conv-neural-network

How to correct name weight not define error

How to correct name weight not define error Question: I am learning python by printing the output line by line from this tutorial https://towardsdatascience.com/convolution-neural-network-for-image-processing-using-keras-dc3429056306 and find out what does each line do. At the last line of code I facing error weight not define but it seem the code is running fine without the need …

Total answers: 1

Can't save CNN model using tensorflow without training it again

Can't save CNN model using tensorflow without training it again Question: I’m trying to save a Sequential CNN model. I’ve found that I can save it using model.save() but after I try to load it back using keras.models.load_model() it starts training itself again. How can I save my model so I don’t need to train …

Total answers: 2

Using Convolutions on the IRIS dataset

Using Convolutions on the IRIS dataset Question: In the famous iris dataset, I have tried, different ML models such as linear regression, SVM, Decision Trees, and Random Forests. I want to use a convolution network. I saw this in a quora post and found it to be interesting. This is just for curiosity, but how …

Total answers: 1

Why accuracy manually calculated by model.predict() is different from model.evaluate()'s accuracy

Why accuracy manually calculated by model.predict() is different from model.evaluate()'s accuracy Question: The accuracy calculated using the predicted labels and the true labels is particularly low, is there something I’ve written wrong? Asked By: Roger.H || Source Answers: Because your data will be randomly shuffled two times. The first one is when you call modified.predict(test_data). …

Total answers: 1

model.predict throws ValueError: expected shape=(None, 64, 64, 3), found shape=(None, 64, 3)

model.predict throws ValueError: expected shape=(None, 64, 64, 3), found shape=(None, 64, 3) Question: 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([ # Convolutional layer. Learn 32 filters using a 3×3 kernel tf.keras.layers.Conv2D(32, (3, 3), activation="relu", …

Total answers: 1

No such file or directory

No such file or directory Question: I can’t run my python file due to error saying File "Application.py", line 32, in __init__ self.json_file = open("Modelsmodel_new.json", "r") FileNotFoundError: [Errno 2] No such file or directory: ‘Models\model_new.json’ This is my program code class Application: def __init__(self): self.hs = Hunspell(‘en_US’) self.vs = cv2.VideoCapture(0) self.current_image = None self.current_image2 = …

Total answers: 2

How does loss of information lead to better accuracy?

How does loss of information lead to better accuracy? Question: So, I’ve been looking into the following code # Define the model model = tf.keras.models.Sequential([ # Add convolutions and max pooling tf.keras.layers.Conv2D(32, (3,3), activation=’relu’, input_shape=(28, 28, 1)), tf.keras.layers.MaxPooling2D(2, 2), tf.keras.layers.Conv2D(32, (3,3), activation=’relu’), tf.keras.layers.MaxPooling2D(2, 2), # Add the same layers as before tf.keras.layers.Flatten(), tf.keras.layers.Dense(128, activation=’relu’), tf.keras.layers.Dense(10, …

Total answers: 3