From a35cc49d4b05a03e48f4b4a3f4d6becd1c1e54c7 Mon Sep 17 00:00:00 2001 From: Guillaume Dumont Date: Sat, 11 Mar 2017 19:39:00 -0500 Subject: [PATCH] Added train_lenet.ps1, fixed create_mnist.ps1 and update mnist readme.md for windows. --- examples/mnist/create_mnist.ps1 | 4 ++-- examples/mnist/readme.md | 2 +- examples/mnist/train_lenet.ps1 | 10 ++++++++++ 3 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 examples/mnist/train_lenet.ps1 diff --git a/examples/mnist/create_mnist.ps1 b/examples/mnist/create_mnist.ps1 index 8c6d72394e2..6bb4b2812ac 100644 --- a/examples/mnist/create_mnist.ps1 +++ b/examples/mnist/create_mnist.ps1 @@ -6,10 +6,10 @@ param( $ErrorActionPreference = 'Stop' -$CaffeRoot = Resolve-Path (Join-Path $PSScriptRoot ..\..) +$CaffeRoot = (Resolve-Path (Join-Path $PSScriptRoot ..\..)) $EXAMPLE = "$CaffeRoot\examples\mnist" $DATA = "$CaffeRoot\data\mnist" -if($BuildDir -eq $null) { +if("$BuildDir" -eq "") { $BuildDir = "$CaffeRoot\build" } $BUILD = "$BuildDir\examples\mnist" diff --git a/examples/mnist/readme.md b/examples/mnist/readme.md index 35952155a30..11dbdf77c84 100644 --- a/examples/mnist/readme.md +++ b/examples/mnist/readme.md @@ -8,7 +8,7 @@ priority: 1 # Training LeNet on MNIST with Caffe -We will assume that you have Caffe successfully compiled. If not, please refer to the [Installation page](/installation.html). In this tutorial, we will assume that your Caffe installation is located at `CAFFE_ROOT`. +We will assume that you have Caffe successfully compiled. If not, please refer to the [Installation page](/installation.html). In this tutorial, we will assume that your Caffe installation is located at `CAFFE_ROOT`. On Windows use the powershell (`.ps1`) instead of the bash (`.sh`) scripts. ## Prepare Datasets diff --git a/examples/mnist/train_lenet.ps1 b/examples/mnist/train_lenet.ps1 new file mode 100644 index 00000000000..912c62cea15 --- /dev/null +++ b/examples/mnist/train_lenet.ps1 @@ -0,0 +1,10 @@ +param( + [string]$BuildDir +) + +$CaffeRoot = (Resolve-Path (Join-Path $PSScriptRoot ..\..)) +if("$BuildDir" -eq "") { + $BuildDir = "$CaffeRoot\build" +} + +. $BuildDir\tools\caffe.exe train --solver=examples\mnist\lenet_solver.prototxt $args