File tree 8 files changed +87
-15
lines changed
8 files changed +87
-15
lines changed Original file line number Diff line number Diff line change 36
36
- ./samples/mnist/run_mnist_test.sh
37
37
- ./samples/cifar10/run_cifar10_train.sh
38
38
- ./samples/cifar10/run_cifar10_test.sh
39
+ - ./samples/cifar100/run_cifar100_train.sh
40
+ - ./samples/cifar100/run_cifar100_test.sh
39
41
- stage : benchmarks
40
42
script :
41
43
- mkdir build
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ if (NOT EXISTS "${DATASETS_DIR}/MNIST")
19
19
file (REMOVE "${DATASETS_DIR} /MNIST.zip" )
20
20
endif ()
21
21
22
+ # NB: Download CIFAR10 dataset if it doesn't exist
22
23
if (NOT EXISTS "${DATASETS_DIR} /CIFAR10" )
23
24
message (STATUS "Downloading CIFAR10 dataset" )
24
25
file (DOWNLOAD
@@ -31,3 +32,17 @@ if (NOT EXISTS "${DATASETS_DIR}/CIFAR10")
31
32
file (RENAME "${DATASETS_DIR} /CIFAR-10-JPG-master" "${DATASETS_DIR} /CIFAR10" )
32
33
file (REMOVE "${DATASETS_DIR} /CIFAR10.zip" )
33
34
endif ()
35
+
36
+ # NB: Download CIFAR100 dataset if it doesn't exist
37
+ if (NOT EXISTS "${DATASETS_DIR} /CIFAR100" )
38
+ message (STATUS "Downloading CIFAR100 dataset" )
39
+ file (DOWNLOAD
40
+ https://github.com/SemicolonStruggles/CIFAR-100-JPG/archive/refs/heads/master.zip
41
+ "${DATASETS_DIR} /CIFAR100.zip" SHOW_PROGRESS )
42
+
43
+ execute_process (COMMAND ${CMAKE_COMMAND} -E tar xf "CIFAR100.zip"
44
+ WORKING_DIRECTORY "${DATASETS_DIR} " )
45
+
46
+ file (RENAME "${DATASETS_DIR} /CIFAR-100-JPG-master" "${DATASETS_DIR} /CIFAR100" )
47
+ file (REMOVE "${DATASETS_DIR} /CIFAR100.zip" )
48
+ endif ()
Original file line number Diff line number Diff line change @@ -8,3 +8,4 @@ export DATASETS_DIR=<path-to-deepworks-root>/datasets
8
8
9
9
* [ MNIST sample] ( ./mnist/README.md )
10
10
* [ CIFAR10 sample] ( ./cifar10/README.md )
11
+ * [ CIFAR100 sample] ( ./cifar100/README.md )
Original file line number Diff line number Diff line change @@ -31,10 +31,10 @@ Accuracy: 0.343249
31
31
You can also run samples using binary target directly:
32
32
* Run train:
33
33
``` bash
34
- ./bin/sample_cifar10_train train < path-to-deepworks> /datasets/CIFAR10 < batch_size> < num_epochs> < dump-frequency>
34
+ ./bin/sample_cifar10_train train < path-to-deepworks> /datasets/CIFAR10 < batch_size> < num_epochs> < dump-frequency> < path-to-dump >
35
35
```
36
36
37
37
* Run test:
38
38
``` bash
39
- ./bin/sample_cifar10_train test < path-to-deepworks> /datasets/CIFAR10 < batch_size>
39
+ ./bin/sample_cifar10_train test < path-to-deepworks> /datasets/CIFAR10 < batch_size> < path-to-model >
40
40
```
Original file line number Diff line number Diff line change 1
- # Training simple network on CIFAR100 dataset
2
- ## Download CIFAR100 dataset
1
+ ## Training convolution network on CIFAR100 dataset
2
+
3
+ * Follow instruction to setup enviroment: [ DeepWorks samples] ( ../README.md )
4
+
5
+ * Run train:
6
+ ``` bash
7
+ ./samples/mnist/run_cifar100_train.sh
8
+ ```
9
+
10
+ Possible output:
11
+ ``` bash
12
+ Epoch: 0
13
+ Loss: 4.60511
14
+ Loss: 4.55751
15
+ Loss: 4.44311
16
+ Loss: 4.42878
17
+ Accuracy: 0.0556891
18
+ Model saved: build/cifar100_model.bin
3
19
```
4
- cd /tmp
5
- wget -O CIFAR100.zip https://github.com/SemicolonStruggles/CIFAR-100-JPG/archive/refs/heads/master.zip
6
- unzip CIFAR100.zip
7
- mv CIFAR-100-JPG-master CIFAR100
20
+
21
+ * Run test:
22
+ ``` bash
23
+ ./samples/mnist/run_cifar100_test.sh
24
+ ```
25
+
26
+ Output:
27
+ ``` bash
28
+ Accuracy: 0.0556891
8
29
```
9
30
10
- ## Build & Run
31
+ You can also run samples using binary target directly:
32
+ * Run train:
33
+ ``` bash
34
+ ./bin/sample_cifar100_train train < path-to-deepworks> /datasets/CIFAR100 < batch_size> < num_epochs> < dump-frequency> < path-to-dump>
11
35
```
12
- cd <deepworks-build>
13
- cmake ../ -DBUILD_SAMPLES=ON -DCMAKE_BUILD_TYPE=Release
14
- make -j8
15
- ./bin/sample_cifar100_train /tmp /CIFAR100 <batch_size> <num_epochs> <dump-frequency >
36
+
37
+ * Run test:
38
+ ``` bash
39
+ ./bin/sample_cifar100_train test < path-to-deepworks > /datasets /CIFAR100 < batch_size> < path-to-model >
16
40
```
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ if test -z ${DW_BUILD_PATH}
4
+ then
5
+ echo " Please specify DW_BUILD_PATH variable that is the path to deepworks binary files."
6
+ exit
7
+ fi
8
+
9
+ if test -z ${DATASETS_DIR}
10
+ then
11
+ echo " Please specify DATASETS_DIR variable that is the path to deepworks datasets."
12
+ exit
13
+ fi
14
+
15
+ ${DW_BUILD_PATH} /bin/sample_cifar100_train test ${DATASETS_DIR} /CIFAR100/ 128 ${DW_BUILD_PATH} /cifar100_model.bin
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ if test -z ${DW_BUILD_PATH}
4
+ then
5
+ echo " Please specify DW_BUILD_PATH variable that is the path to deepworks binary files."
6
+ exit
7
+ fi
8
+
9
+ if test -z ${DATASETS_DIR}
10
+ then
11
+ echo " Please specify DATASETS_DIR variable that is the path to deepworks datasets."
12
+ exit
13
+ fi
14
+
15
+ ${DW_BUILD_PATH} /bin/sample_cifar100_train train ${DATASETS_DIR} /CIFAR100/ 128 1 1000 ${DW_BUILD_PATH} /cifar100_model.bin
Original file line number Diff line number Diff line change @@ -35,10 +35,10 @@ Accuracy: 0.96244
35
35
You can also run samples using binary target directly:
36
36
* Run train:
37
37
``` bash
38
- ./bin/sample_mnist_train train < path-to-deepworks> /datasets/MNIST < batch_size> < num_epochs> < dump-frequency>
38
+ ./bin/sample_mnist_train train < path-to-deepworks> /datasets/MNIST < batch_size> < num_epochs> < dump-frequency> < path-to-dump >
39
39
```
40
40
41
41
* Run test:
42
42
``` bash
43
- ./bin/sample_mnist_train test < path-to-deepworks> /datasets/MNIST < batch_size>
43
+ ./bin/sample_mnist_train test < path-to-deepworks> /datasets/MNIST < batch_size> < path-to-model >
44
44
```
You can’t perform that action at this time.
0 commit comments