serizba / cppflow

Run TensorFlow models in C++ without installation and without Bazel

Home Page:https://serizba.github.io/cppflow/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cppflow::decode_jpeg causes HEAP CORRUPTION error

GivenAward opened this issue · comments

I'm following https://serizba.github.io/cppflow/examples.html to use cppflow.
But it causes HEAP CORRUPTION DETECTED error...

my code

#include "cppflow/cppflow.h"
int main()
{
    std::string img_path = "C:/0.jpg";
    std::string model_path = "C:/saved_model";

    auto input = cppflow::decode_jpeg(cppflow::read_file(img_path));
    input = cppflow::cast(input, TF_UINT8, TF_FLOAT);
    input = cppflow::expand_dims(input, 0);
    cppflow::model model(model_path);
    auto output = model(input);
}