zoukankan      html  css  js  c++  java
  • C+++-------------------->>>>将数据保存再txt文件中

    //临时添加的生成txt文件,可以删除
    std::cout<<"outputs[1].size: "<<outputs[1].size<<outputs_attr[1].n_elems * sizeof(float)<<std::endl;
    ofstream outfile_odm_loc;
    ofstream outfile_arm_loc;
    ofstream outfile_arm_conf_flatten;
    ofstream outfile_odm_conf_flatten;



    int length = sizeof(caffe_odm_loc);///sizeof(caffe_odm_loc[1]);
    std::cout<<length<<std::endl;
    outfile_odm_loc.open("./outfile_odm_loc.txt");
    if(!outfile_odm_loc) cout<<"error"<<endl;
    for(int i=0;i<outputs[0].size/4;i++){

    outfile_odm_loc<<caffe_odm_loc[i]<<std::endl;

    }
    outfile_odm_loc.close();
    std::cout<<"fish1: "<<std::endl;



    outfile_arm_loc.open("./outfile_arm_loc.txt");
    if(!outfile_arm_loc) cout<<"error"<<endl;

    for(int v=0;v<outputs[1].size/4;v++){

    std::cout<<"sum_count: "<<v<< " "<<caffe_arm_loc[v]<<std::endl;
    outfile_arm_loc<<caffe_arm_loc[v]<<std::endl;
    }
    outfile_arm_loc.close();
    std::cout<<"fish2: "<<std::endl;


    std::cout<<"fish3: "<<sizeof(caffe_arm_conf_flatten)<<std::endl;
    outfile_arm_conf_flatten.open("./outfile_arm_conf_flatten.txt");
    if(!outfile_arm_conf_flatten) cout<<"error"<<endl;
    for(int k=0;k<outputs[2].size/4;k++){

    outfile_arm_conf_flatten<<caffe_arm_conf_flatten[k]<<std::endl;
    }
    outfile_arm_conf_flatten.close();
    std::cout<<"fish3: "<<std::endl;



    outfile_odm_conf_flatten.open("./outfile_odm_conf_flatten11.txt");
    if(!outfile_odm_conf_flatten) cout<<"error"<<endl;
    for(int j=0;j<outputs[3].size/4;j++){

    outfile_odm_conf_flatten<<caffe_odm_conf_flatten[j]<<std::endl;
    }
    outfile_odm_conf_flatten.close();
    std::cout<<"fish4: "<<std::endl;

  • 相关阅读:
    docker-compose命令简介及安装
    Dockerfile文件常用指令详解
    Keras API记录
    EM(最大期望)算法推导、GMM的应用与代码实现
    K均值聚类和代码实现
    Keras DEMO
    多元函数链式法则与反向传播算法的实例推演
    神经网络中常用的激活函数
    TIKZ——LaTeX基本绘图
    python 爬虫基本玩法,统计杭电oj题目正确率并排序
  • 原文地址:https://www.cnblogs.com/shuimuqingyang/p/14538760.html
Copyright © 2011-2022 走看看