Loading in your own data - Deep Learning basics with Python, TensorFlow and Keras p.2

sentdex · 906K views · 2018 · 18:51

Open on YouTube

Machine learning & deep learningComputer vision, speech & NLPPython, Ruby & scripting languagestutorial

Why Stack Overflow recommends it

Stack Overflow users link it as the tutorial they followed to load custom image folders into numpy arrays, then hit errors with it in their own datasets.

Recommended by 0 people across 0 different months, 2019 to 2021.

What it is

Part 2 of sentdex's Deep Learning basics series, a Python tutorial on loading your own image data instead of a built-in dataset. It uses the Microsoft Dogs vs Cats dataset, walking through reading images with OpenCV, resizing, labeling, shuffling and saving the arrays for a Keras model.

What people said

Cites Colin Warn · 2019-01 · Stack Overflow · on “Number of Labels Always 1/3rd the Number of Features”

Going through a Sentdex Deep Learning tutorial [this video] , I'm trying to figure out why the number of labels in my training set is always 1/3rd of the number of features. Not sure why this is happening. import numpy as np import matplotlib.pyplot as plt import os import random import cv2 import pickle IMG_SIZE = 50 DATADIR = r"D:\Machine Learning\all\train\train" CATEGORIES = ["Dog", "Cat"] training_data = [] def createTrainingData(): for category in CATEGORIES: path = os.path.join(DATADIR, category) class_num = CATEGORIES.index(category) for img in os.listdir(path): try: img_array = cv2.imread(os.path.join(path, img), cv2.IMREAD_GRAYSCALE) print(img) new_array = cv2.resize(img_array, (IMG_SIZ

Cites Kim404 · 2020-04 · Stack Overflow · on “I faced an empty training_Data”

So I tried this tutorial [this video] (minutes 11:58) trying to implement on my CNN which consist of 10 species on the dataset. i got no error to load data DATADIR = "dataset" CATEGORIES = ["Dendrobium_crumenatum","Grammatophyllum_speciosum", "Coelogyne_swaniana", "Bulbophyllum_purpurascens", "Agrostophyllum_stipulatum", "Spathoglottis_plicata", "Phalaenopsis_amabilis", "Nabaluia_angustifolia", "Habenaria_rhodocheila_hance"] here the example of the output [![enter image description here][2]][2] then the next section is training_data = [] def create_training_data(): for category in CATEGORIES: path = os.path.join(DATADIR,category) class_num = CATEGORIES.index(category) for img in os.listdir(path):

Cites DapperDuck · 2021-01 · Stack Overflow · on “How to load large numpy file without memory dump into kaggle notebook?”

I am working with a dataset [LINK] to train a Keras Deep Learning model on a Kaggle notebook with a GPU. The dataset has a csv which contains an id, for a .tif image in another directory, and a label, 1 or 0. I balanced the data and saved it using numpy.save() (See Code 1). This works fine and afterwards, I download the files and reupload them as a dataset. However, when I try to use this dataset in a different notebook using numpy.load() (See Code 2), I get the following error: Your notebook tried to allocate more memory than is available. It has restarted. I have been following this tutorial [this video] , and it's a few years old, so I might be doing unnecessary steps while making the array. H

Cites anikus · 2021-05 · Stack Overflow · on “Zero loss and validation loss in Keras CNN model”

I am attempting to run a crowd estimation model that classifies the images into three different broad categories depending on how many people there are in the images. 1200 images are used for training, with 20% of it used for validation. I used sentdex's tutorial on Youtube [this video] as reference to load the image data into the model; I load the images as a zip file, extract it and categorise them based on the folders they are in. My issue is that whenever I attempt to train the model, I noticed that the loss and validation loss is always 0, which has resulted in the model not exactly training and the validation accuracy remaining the same throughout, as seen here [LINK] . How can I get the lo

Cites Arnima Shrestha · 2021-06 · Stack Overflow · on “Why does an error occur when trying to open a directory?”

so basically what I'm trying to do is get my files from my directory, following this tutorial: [this video] , and this kaggle dataset: [LINK] but it seems to error? #loading in data from kaggle #from : [this video] #importing the libraries to see the actual images import numpy as np import matplotlib.pyplot as plt import os import cv2 #the kaggle download had three folders(consonants, vowels and numbers), looking at the vowels number DATADIR= "C:/Users/binju/Downloads/archive.zip/Images/Images" CAT= ['character_1_ka', 'character_2_kha', 'character_3_ga', 'character_4_gha', 'character_5_kna'] #paths directory for category in CAT: path= os.path.join(DATADIR, category) print("this is the path:", path) fo