caffe+win10+git使用sh文件

在windows下是否可以执行sh文件呢,搜了一下,可以安装了git就可以执行,当然这不是唯一答案。

然后联想到caffe下有一些.sh文件可以尝试,就用create_mnist.sh尝试把。

create_mnist.sh原文件内容为:

 1 #!/usr/bin/env sh
 2 # This script converts the mnist data into lmdb/leveldb format,
 3 # depending on the value assigned to $BACKEND.
 4 
 5 EXAMPLE=examples/mnist
 6 DATA=data/mnist
 7 BUILD=build/examples/mnist
 8 
 9 BACKEND="lmdb"
10 
11 echo "Creating ${BACKEND}..."
12 
13 rm -rf $EXAMPLE/mnist_train_${BACKEND}
14 rm -rf $EXAMPLE/mnist_test_${BACKEND}
15 
16 $BUILD/convert_mnist_data.bin $DATA/train-images-idx3-ubyte \
17   $DATA/train-labels-idx1-ubyte $EXAMPLE/mnist_train_${BACKEND} --backend=${BACKEND}
18 $BUILD/convert_mnist_data.bin $DATA/t10k-images-idx3-ubyte \
19   $DATA/t10k-labels-idx1-ubyte $EXAMPLE/mnist_test_${BACKEND} --backend=${BACKEND}
20 
21 echo "Done."

修改内容,将:

BUILD=build/examples/mnist
convert_mnist_data.bin

改为:

BUILD=build/examples/mnist/Release
convert_mnist_data.exe

改完后内容为:

#!/usr/bin/env sh
# This script converts the mnist data into lmdb/leveldb format,
# depending on the value assigned to $BACKEND.

EXAMPLE=examples/mnist
DATA=data/mnist
BUILD=build/examples/mnist/Release

BACKEND="lmdb"

echo "Creating ${BACKEND}..."

rm -rf $EXAMPLE/mnist_train_${BACKEND}
rm -rf $EXAMPLE/mnist_test_${BACKEND}

$BUILD/convert_mnist_data.exe $DATA/train-images-idx3-ubyte \
  $DATA/train-labels-idx1-ubyte $EXAMPLE/mnist_train_${BACKEND} --backend=${BACKEND}
$BUILD/convert_mnist_data.exe $DATA/t10k-images-idx3-ubyte \
  $DATA/t10k-labels-idx1-ubyte $EXAMPLE/mnist_test_${BACKEND} --backend=${BACKEND}

echo "Done."

看懂上面的命令是关键,从命令看,

git应该从caffe根目录执行,

mnist数据放在:data/mnist目录下;

data/mnist目录下的文件名为:train-labels-idx1-ubyte、train-labels-idx1-ubyte、t10k-labels-idx1-ubyte、t10k-labels-idx1-ubyte

生成文件到目录:examples/mnist/mnist_train_lmdb、examples/mnist/mnist_test_lmdb。

下图是git执行结果。

 

 

posted @ 2020-02-27 17:33  巨鹿王十二  阅读(333)  评论(0编辑  收藏  举报