Skip to content

Example to load, train, and evaluate ImageNet2012 dataset on a Keras model

Notifications You must be signed in to change notification settings

mostafaelhoushi/keras-imagenet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

This repo is a simple example to load data using TensorFlow Datasets and evaluating and training a Keras model using Keras Generators.

There is room for speeding up or pipelining the loading, so please feel free to create a Pull request!

Downloading ImageNet

TensorFlow Datasets expects ImageNet to be downloaded to a specific directory in your home, so you need to follow these steps for the script to run:

  1. Create the directory where the ImageNet should reside:
mkdir -p ~/tensorflow_datasets/downloads/manual/imagenet2012
  1. Visit Image-Net Downloads page and create a user account with Image-Net if you haven't done so already.

  2. Go to Download links to ILSVRC2012 image data page.

  3. Download ILSVRC2012_img_train.tar from Training images (Task 1 & 2) to ~/tensorflow_datasets/downloads/manual/imagenet2012

  4. Download ILSVRC2012_img_val.tar from Validation images (all tasks) to ~/tensorflow_datasets/downloads/manual/imagenet2012

Getting Started

  1. Clone the repo:
git clone https://github.com/mostafaelhoushi/keras-imagenet.git
  1. cd into the directory
cd keras-imagenet
  1. [Recommended] The code has been tested on specific versions of Keras, TensorFlow, and TensorFlow Datasets, so we recommend to install those specific versions in a local environment using virtualenv:
virtualenv venv
source venv/bin/activate
pip install keras==2.2.4
pip install tensorflow==1.13.1
pip install tensorflow-datasets==1.0.1
pip install pillow
pip install opencv-python
  1. Run the example:
python imagenet_mobilenet.py

About

Example to load, train, and evaluate ImageNet2012 dataset on a Keras model

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages