Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use caffe to test mnist datasets

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article introduces you how to use caffe to test mnist data set, the content is very detailed, interested friends can refer to, hope to be helpful to you.

Want to get started in-depth learning without a few weapons is not, the current popular framework tensorflow, pytorch, caffe, etc., the author is also recently contacted with caffe, found that caffe is very suitable for beginners entry-level deep learning. You don't have to learn Python first and then tf like tensorflow. It feels like you're relearning a language. Caffe is prepared by C++, so download from github after you need to compile, it is gratifying that caffe also supports windows, you go to github to download caffe released by Microsoft with vs2013 compilation can be successful, it also distinguishes the cpu version from the gpu version, how to compile and install Baidu tutorials are basically available, the author in windows and ubuntu are compiled successfully. Entry-level children's shoes basically come into contact with the first course is mnist recognition of handwritten numbers, caffe can undoubtedly let you the fastest to build the entire network and run through.

This assumes that you have installed caffe. Caffe gives us a lot of examples, installed caffe, in the example folder, there are many off-the-shelf networks, take mnist as an example. First of all, we need to download the mnist dataset. When we enter the data folder, there is a script caffe/data/mnist/get_mnist.sh that obtains the data. After the execution is completed, we will get the following files, which are the samples and tags of the test set and training set, respectively, judged by their names.

Go to the caffe/examples/mnist folder and execute the. / create_mnist.sh script. If your caffe is not compiled, it may prompt the error convert_mnist_data.bin: not found. Just recompile the caffe. After the script is executed successfully, you will get two folders.

Lmdb is a database that queries and inserts very efficiently. Caffe uses lmdb as the data source, while caffe also supports hdf5 files.

Caffe builds the network based on the prototxt file, and the hyperparameters are also configured in it. So you only need to configure the network and super-parameter prototxt files according to your own needs. In the mnist directory, there are the following files:

Find the file caffe/examples/mnist/lenet_train_test.prototxt this file is for training, if you want to customize the network, you can configure the network with this file.

Simple and rough configuration, I believe you are easy to understand, configure data sources, define layer types.

You also need the caffe/examples/mnist/lenet_sover.prototxt file. The lenet_solver file is used to configure hyperparameters. Open this file.

The box selects several important configurations. First, define the location of the network file, configure the iterations of the test set, and define the learning rate. As well as the maximum number of iterations, the end of the file is also free to define the path where the snapshot is generated using GPU or CPU,snapshot_prefix, which should be configured here. It is also recommended that the data source be configured with an absolute path so that the following command can be executed in any directory.

Find the caffe under the tools folder and configure the solver path to run it.

Some children's shoes may fail with my command, you only need to check whether the three paths are configured correctly, one is the net path in the solver file, the snapshot path, and the data source path in the network file. Also pay attention to the path under which you execute train commands.

If the above interface appears, congratulations, you have succeeded.

On how to use caffe to test the mnist data set is shared here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report