All Projects → kratzert → Finetune_alexnet_with_tensorflow

kratzert / Finetune_alexnet_with_tensorflow

Licence: bsd-3-clause
Code for finetuning AlexNet in TensorFlow >= 1.2rc0

Projects that are alternatives of or similar to Finetune alexnet with tensorflow

How To Predict Stock Prices Easily Demo
How to Predict Stock Prices Easily - Intro to Deep Learning #7 by Siraj Raval on Youtube
Stars: ✭ 729 (-2.54%)
Mutual labels:  jupyter-notebook
Essentialmath
Stars: ✭ 735 (-1.74%)
Mutual labels:  jupyter-notebook
Spark Movie Lens
An on-line movie recommender using Spark, Python Flask, and the MovieLens dataset
Stars: ✭ 745 (-0.4%)
Mutual labels:  jupyter-notebook
Matplotlib Gallery
Examples of matplotlib codes and plots
Stars: ✭ 730 (-2.41%)
Mutual labels:  jupyter-notebook
Swift
Swift for TensorFlow
Stars: ✭ 6,037 (+707.09%)
Mutual labels:  jupyter-notebook
Nbstripout
strip output from Jupyter and IPython notebooks
Stars: ✭ 738 (-1.34%)
Mutual labels:  jupyter-notebook
Ecco
Visualize and explore NLP language models. Ecco creates interactive visualizations directly in Jupyter notebooks explaining the behavior of Transformer-based language models (like GPT2).
Stars: ✭ 723 (-3.34%)
Mutual labels:  jupyter-notebook
Deeprl Tutorials
Contains high quality implementations of Deep Reinforcement Learning algorithms written in PyTorch
Stars: ✭ 748 (+0%)
Mutual labels:  jupyter-notebook
Pandas exercises
Practice your pandas skills!
Stars: ✭ 7,140 (+854.55%)
Mutual labels:  jupyter-notebook
Mememoji
A facial expression classification system that recognizes 6 basic emotions: happy, sad, surprise, fear, anger and neutral.
Stars: ✭ 743 (-0.67%)
Mutual labels:  jupyter-notebook
Juliatutorials
Learn Julia via interactive tutorials!
Stars: ✭ 732 (-2.14%)
Mutual labels:  jupyter-notebook
Adjusttext
A small library for automatically adjustment of text position in matplotlib plots to minimize overlaps.
Stars: ✭ 731 (-2.27%)
Mutual labels:  jupyter-notebook
Getting Things Done With Pytorch
Jupyter Notebook tutorials on solving real-world problems with Machine Learning & Deep Learning using PyTorch. Topics: Face detection with Detectron 2, Time Series anomaly detection with LSTM Autoencoders, Object Detection with YOLO v5, Build your first Neural Network, Time Series forecasting for Coronavirus daily cases, Sentiment Analysis with BERT.
Stars: ✭ 738 (-1.34%)
Mutual labels:  jupyter-notebook
Numerical Computing Is Fun
Learning numerical computing with notebooks for all ages.
Stars: ✭ 730 (-2.41%)
Mutual labels:  jupyter-notebook
Dat4
General Assembly's Data Science course in Washington, DC
Stars: ✭ 748 (+0%)
Mutual labels:  jupyter-notebook
Keras realtime multi Person pose estimation
Keras version of Realtime Multi-Person Pose Estimation project
Stars: ✭ 728 (-2.67%)
Mutual labels:  jupyter-notebook
Sgx Full Orderbook Tick Data Trading Strategy
Providing the solutions for high-frequency trading (HFT) strategies using data science approaches (Machine Learning) on Full Orderbook Tick Data.
Stars: ✭ 733 (-2.01%)
Mutual labels:  jupyter-notebook
Causal inference python code
Python code for part 2 of the book Causal Inference: What If, by Miguel Hernán and James Robins
Stars: ✭ 748 (+0%)
Mutual labels:  jupyter-notebook
Gans In Action
Companion repository to GANs in Action: Deep learning with Generative Adversarial Networks
Stars: ✭ 748 (+0%)
Mutual labels:  jupyter-notebook
Neural Processes
This repository contains notebook implementations of the following Neural Process variants: Conditional Neural Processes (CNPs), Neural Processes (NPs), Attentive Neural Processes (ANPs).
Stars: ✭ 744 (-0.53%)
Mutual labels:  jupyter-notebook

Finetune AlexNet with Tensorflow

Update 15.06.2016

I revised the entire code base to work with the new input pipeline coming with TensorFlow >= version 1.2rc0. You can find an explanation of the new input pipeline in a new blog post You can use this code as before for finetuning AlexNet on your own dataset, only the dependency of OpenCV isn't necessary anymore. The old code can be found in this past commit.

This repository contains all the code needed to finetune AlexNet on any arbitrary dataset. Beside the comments in the code itself, I also wrote an article which you can find here with further explanation.

All you need are the pretrained weights, which you can find here or convert yourself from the caffe library using caffe-to-tensorflow. If you convert them on your own, take a look on the structure of the .npy weights file (dict of dicts or dict of lists).

Note: I won't write to much of an explanation here, as I already wrote a long article about the entire code on my blog.

Requirements

  • Python 3
  • TensorFlow >= 1.2rc0
  • Numpy

TensorBoard support

The code has TensorFlows summaries implemented so that you can follow the training progress in TensorBoard. (--logdir in the config section of finetune.py)

Content

  • alexnet.py: Class with the graph definition of the AlexNet.
  • finetune.py: Script to run the finetuning process.
  • datagenerator.py: Contains a wrapper class for the new input pipeline.
  • caffe_classes.py: List of the 1000 class names of ImageNet (copied from here).
  • validate_alexnet_on_imagenet.ipynb: Notebook to test the correct implementation of AlexNet and the pretrained weights on some images from the ImageNet database.
  • images/*: contains three example images, needed for the notebook.

Usage

All you need to touch is the finetune.py, although I strongly recommend to take a look at the entire code of this repository. In the finetune.py script you will find a section of configuration settings you have to adapt on your problem. If you do not want to touch the code any further than necessary you have to provide two .txt files to the script (train.txt and val.txt). Each of them list the complete path to your train/val images together with the class number in the following structure.

Example train.txt:
/path/to/train/image1.png 0
/path/to/train/image2.png 1
/path/to/train/image3.png 2
/path/to/train/image4.png 0
.
.

were the first column is the path and the second the class label.

The other option is that you bring your own method of loading images and providing batches of images and labels, but then you have to adapt the code on a few lines.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].