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;

  • 相关阅读:
    阅读之分布式架构的数据一致
    阅读之MySQL数据库分表
    阅读笔记1
    问题账户需求分析
    软件需求分析阅读笔记
    开发进度第四天
    开发进度第三天
    开发进度第二天
    线程中三个关键对象闭锁,栅栏,信号量
    java多线程中关于原子操作
  • 原文地址:https://www.cnblogs.com/shuimuqingyang/p/14538760.html
Copyright © 2011-2022 走看看