GitXplorerGitXplorer
C

tensorflow-model-zoo.torch

public
291 stars
88 forks
8 issues

Commits

List of commits on branch master.
Unverified
24fee252639bdb88db74a0a6bb5c2cabef5e57e3

Add inceptionresnetv2 pretrained in pytorch (Prec@5 95.234 imagenet)

CCadene committed 8 years ago
Unverified
7a2fe3709fa3fa13546ebd8fec65959c96122c2f

Add norm and noReLU

CCadene committed 8 years ago
Unverified
ec70e06be3214518d05c7e8f9b7f23d38f476a4c

Add bias to some conv2d

CCadene committed 8 years ago
Unverified
789f9515435b5650791f5ea4fb847400db28095f

Add lena 299

CCadene committed 8 years ago
Unverified
882071df9d7823b11568ef435153992263e740d0

Add tensorflow_dump for InceptionResnetV2

CCadene committed 8 years ago
Unverified
a28a35dd8842bdbcee60fffac9d1e9712af18b95

Add lena_224

CCadene committed 8 years ago

README

The README file for this repository.

Tensorflow Model Zoo for Torch7 and PyTorch (OBSOLETE)

13/07/2017: Please use the new repo pretrained-models.pytorch which includes inceptionv4 and inceptionresnetv2 with a nicer API.

This is a porting of tensorflow pretrained models made by Remi Cadene and Micael Carvalho. Special thanks to Moustapha Cissé. All models have been tested on Imagenet.

This work was inspired by inception-v3.torch.

Using pretrained models

Torch7

Requirements

Please install torchnet-vision.

luarocks install --server=http://luarocks.org/dev torchnet-vision

Models available:

  • inceptionv3
  • inceptionv4
  • inceptionresnetv2
  • resnet{18, 34, 50, 101, 152, 200}
  • overfeat
  • vggm
  • vgg16

Simple example

require 'image'
tnt = require 'torchnet'
vision = require 'torchnet-vision'
model = vision.models.inceptionresnetv2
net = model.load()

augmentation = tnt.transform.compose{
   vision.image.transformimage.randomScale{
   	minSize = 299, maxSize = 350
   },
   vision.image.transformimage.randomCrop(299),
   vision.image.transformimage.colorNormalize{
      mean = model.mean, std  = model.std
   },
   function(img) return img:float() end
}

net:evaluate()
output = net:forward(augmentation(image.lena()))

PyTorch

Currently available in this repo only On pytorch/vision maybe!

Models available:

  • inceptionv4
  • inceptionresnetv2

Simple example

import torch
from inceptionv4.pytorch_load import inceptionv4
net = inceptionv4()
input = torch.autograd.Variable(torch.ones(1,3,299,299))
output = net.forward(input)

Reproducing the porting

Requirements

  • Tensorflow
  • Torch7
  • PyTorch
  • hdf5 for python3
  • hdf5 for lua

Example of commands

In Tensorflow: Download tensorflow parameters and extract them in ./dump directory.

python3 inceptionv4/tensorflow_dump.py

In Torch7 or PyTorch: Create the network, load the parameters, launch few tests and save the network in ./save directory.

th inceptionv4/torch_load.lua
python3 inceptionv4/pytorch_load.py