Caffe中Flages的安装与使用!
来源:互联网 发布:网络喷子 编辑:程序博客网 时间:2024/04/30 03:20
调试Caffe的过程,小伙伴们应该都知道,需要通过.bat或.sh,把相关的命令传到Caffe.exe中,那么Caffe的命令传入是怎么实现的呢!下面给大家做一个简单的介绍,Caffe中命令的传入借用了google的开源工具gflags,因google被和谐的原因,在网上找到现在gflags被转到github中https://github.com/gflags/gflags,在里面下载原码!然后通过Cmake进行编译出第三方库(vs2012所使用的.lib与.h文件)。
百度云gflags-master:http://pan.baidu.com/s/1qYCSUL2 密码:32cg
百度云CMake:http://pan.baidu.com/s/1slyDJ33 密码:t9t2
然后利用Cmake进行编译即可生成gflags第三方VS2012所需要的.h和.lib。具体可以考考http://blog.csdn.net/lming_08/article/details/25072899;以下是我编写的gflags测试代码。
#include "iostream"#include "gflags/gflags.h"#pragma comment (lib,"gflags_nothreads_static.lib")#pragma comment (lib,"gflags_static.lib")#pragma comment (lib,"shlwapi.lib")// 定义对 FLAGS_port 的检查函数static bool ValidatePort(const char* name, int32_t value) {if (value > 0 && value < 32768) {return true;}printf("Invalid value for --%s: %d\n", name, (int)value);return false;}DEFINE_string(host, "127.0.0.1", "the server host");DEFINE_int32(port, 12306, "the server port");static const bool port_dummy = gflags::RegisterFlagValidator(&FLAGS_port, &ValidatePort);int main(int argc, char** argv){// 解析命令行参数,一般都放在 main 函数中开始位置gflags::ParseCommandLineFlags(&argc, &argv, true);std::cout << "The server host is: " << FLAGS_host<< ", the server port is: " << FLAGS_port << std::endl;// 使用 SetCommandLineOption 函数对参数进行设置才会调用检查函数gflags::SetCommandLineOption("port", "-2");std::cout << "The server host is: " << FLAGS_host<< ", the server port is: " << FLAGS_port << std::endl;return 0;}
百度云源程序vs2012编译:http://pan.baidu.com/s/1qYatrRm 密码:int1
0 0
- Caffe中Flages的安装与使用!
- Caffe中Glog日志记录的使用与安装!
- caffe安装过程中与protobuf相关的问题
- Caffe的安装与测试
- Caffe中LMDB的使用
- Caffe与Tensorflow的安装与配置
- caffe与caffe安装教程
- [caffe使用]caffe使用中可能遇到的问题总结
- Caffe的编译与安装(二)
- windows下caffe的安装与配置
- ubantu下caffe的安装与测试
- [caffe]安装中遇到的问题
- caffe在centos中艰难的安装
- caffe 上OpenBLAS的安装使用
- Ubuntu下caffe安装过程中出现的问题与解决方案
- 【Caffe】下载与安装
- 【Caffe】下载与安装
- caffe中安装python
- 【百度】生态质量部 测试开发实习生 电话二面
- Ionic ion-header-bar、bar-subheader、ion-tabs
- 2016年工作总结
- 数字天堂HBuilder+MUI(四)Native.js示例汇总
- 三大主流开源 NoSQL 数据库和两大主流传统 SQL 数据库对比
- Caffe中Flages的安装与使用!
- Big Data Ecosystem and Components
- (39.1) Spring Boot Shiro权限管理【从零开始学Spring Boot】
- 07、一步一步学thinkjs之实现注销以及判断是否登录
- [Paper note] Learning from Simulated and Unsupervised Images through Adversarial Training
- 路径规划
- STL排序算法之swap()
- 第一个微信小程序demo
- Linux之守护进程