diff --git a/benchmark/.gitignore b/benchmark/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..7b66e8a5b5020fd847982db401665d24ba3a069c --- /dev/null +++ b/benchmark/.gitignore @@ -0,0 +1,9 @@ +paddle/image/logs +paddle/image/*.pyc +paddle/image/train.list +paddle/rnn/logs +paddle/rnn/*.pyc +paddle/rnn/imdb.pkl +caffe/image/logs +tensorflow/image/logs +tensorflow/rnn/logs diff --git a/benchmark/paddle/image/provider.py b/benchmark/paddle/image/provider.py index b6bc0e9aa21a1083ddc2c8f3ada4acf637425a62..1ac47212b5a75667e8e9d4465b33f575516e2836 100644 --- a/benchmark/paddle/image/provider.py +++ b/benchmark/paddle/image/provider.py @@ -20,8 +20,7 @@ def initHook(settings, height, width, color, num_class, **kwargs): @provider( init_hook=initHook, min_pool_size=-1, cache=CacheType.CACHE_PASS_IN_MEM) def process(settings, file_list): - with open(file_list, 'r') as fdata: - for line in fdata: - img = np.random.rand(1, settings.data_size).reshape(-1, 1).flatten() - lab = random.randint(0, settings.num_class) - yield img.tolist(), int(lab) + for i in xrange(1024): + img = np.random.rand(1, settings.data_size).reshape(-1, 1).flatten() + lab = random.randint(0, settings.num_class) + yield img.astype('float32'), int(lab) diff --git a/benchmark/paddle/image/run.sh b/benchmark/paddle/image/run.sh index a216928835173f7f7c81d78a97ec3856035edb73..717ed487ba7657db6535efcb1128a355a0f15eaf 100755 --- a/benchmark/paddle/image/run.sh +++ b/benchmark/paddle/image/run.sh @@ -1,21 +1,5 @@ set -e -# If use `paddle train` to run, it must use DataProvider to -# pass the data type to PaddlePaddle system. -# And PaddlePaddle requires training set list (train.list), -function gen_file() { - if [ ! -d "train.txt" ]; then - for ((i=1;i<=1024;i++)) - do - echo "train/n09246464/n09246464_38735.jpeg 972" >> train.txt - done - fi - - if [ ! -d "train.list" ]; then - echo "train.txt" > train.list - fi -} - function train() { cfg=$1 thread=$2 @@ -32,7 +16,9 @@ function train() { > logs/$prefix-${thread}gpu-$bz.log 2>&1 } -gen_file +if [ ! -d "train.list" ]; then + echo " " > train.list +fi if [ ! -d "logs" ]; then mkdir logs fi