Created
March 7, 2020 17:52
-
-
Save novasush/c291bc8a75f2e7ce99d36b51d212ee53 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dataset_name = 'cats_vs_dogs' | |
filePath = f"{getcwd()}/../tmp2" | |
dataset, info = tfds.load(name=dataset_name, split=tfds.Split.TRAIN, with_info=True, data_dir=filePath) | |
print(info.version) | |
def preprocess(features): | |
image = features['image'] | |
image = tf.image.resize(image, (224, 224)) | |
image = image / 255.0 | |
return image, features['label'] | |
train_dataset = dataset.map(preprocess).batch(32) | |
#The next step will be to train the model using the following code: | |
model = create_model() | |
model.fit(train_dataset, epochs=5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment