Code example for convolutional neural network training
- A computer with NVIDIA GPUs (Please, it is important)
- CUDA + CuDNN
- Tensorflow (GPU version)
- python3
- tqdm
Download and generate mnist and fashion datasets:
cd data/mnist/
python3 download_and_convert_mnist.py
and
cd data/fashion
python3 download_and_convert_fashion.py
Change your configurations in the file
gedit source/opt.py
gpu_list = [0]
to use GPU0 or
gpu_list = []
to use cpu
Change your configurations in the file
gedit source/opt.py
Change your configurations in the file
gedit source/nets/mlp.py
or
gedit source/nets/lenet5.py
or add your own network files, don't forget to register them in nets_factory.py
You can also adjust and add other components, such as preprocessing, dataset, and register them in individual factory files.
Start training:
cd source/
python top.py
The training log files will be saved in log/xxxx.txt
You can check the training details in log files, and derive statistics for drawing curves.
And the model will be saved in model/xxxx if you have configured in opt.py