I'm new to TensorFlow and I am trying to build a small neural network in Google Colaboratory. The goal of this network is to identify the occupation of an individual based on an image. I have 900 different images each for 10 different jobs as my training data, and 200 different images from each of these jobs as my testing data. Both the testing and training data are downloaded to my computer. Any help would be greatly appreciated.
Asked
Active
Viewed 74 times
1
-
Does that answer your question? https://stackoverflow.com/questions/46986398/import-data-into-google-colaboratory – fmarm Mar 27 '20 at 02:21
1 Answers
0
First mount your Google Drive to Collaboratory
from google.colab import drive
drive.mount('/content/drive')
Path to directories where Training and Testing data present
train_dir = '/content/drive/Training'
test_dir = '/content/drive/Testing'
Create data generator for training and testing
train_datagen = ImageDataGenerator(**datagen_kwargs)
test_datagen = ImageDataGenerator(**datagen_kwargs)
train_data = train_datagen.flow_from_directory(
train_dir,
target_size = (img_width, img_height),
shuffle=True,
batch_size = batch_size,
classes = list(class_names))
test_data = test_datagen.flow_from_directory(
test_dir,
target_size = (img_width, img_height),
shuffle=True,
batch_size = batch_size,
classes = list(class_names))
For more information please refer this link
-
@noahmessijr, Can you please accept and upvote the answer if it answers your question. Thank You – May 08 '20 at 07:28