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;

posted @   水木清扬  阅读(147)  评论(0编辑  收藏  举报
编辑推荐:
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
点击右上角即可分享
微信分享提示