Code Monkey home page Code Monkey logo

Comments (3)

whjxnyzh123 avatar whjxnyzh123 commented on July 3, 2024 1

oh, i make it complicated
i write another simple code. it worked.

#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<fstream>  // NOLINT(readability/streams)

using namespace std;
int main()
{
    string feature_file = "000001.fc6-1";
    FILE *f;
    f = fopen(feature_file.c_str(), "rb");
    if (f == NULL)
        return false;
    int n, c, l, w, h;

    fread(&n, sizeof(int), 1, f);
    fread(&c, sizeof(int), 1, f);
    fread(&l, sizeof(int), 1, f);
    fread(&h, sizeof(int), 1, f);
    fread(&w, sizeof(int), 1, f);
    cout << n << ' ' << c << ' ' << l << ' ' << w << ' ' << h << endl;
    float * buff = new float[n*c*l*h*w];
    fread(buff, sizeof(float), n*c*l*h*w, f);
    for (int i = 1; i < 10; i++)
        cout << buff[i] << endl;
}

from c3d.

dutran avatar dutran commented on July 3, 2024

Glad to hear, cheers!

from c3d.

Superlee506 avatar Superlee506 commented on July 3, 2024

@whjxnyzh Hi,I'm confused about load the "fc6-1"features.The feature's number is 4096,so why we shoud reshape the data size.
Thanks.

from c3d.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.