serizba / cppflow

Run TensorFlow models in C++ without installation and without Bazel
https://serizba.github.io/cppflow/
MIT License
779 stars 177 forks source link

cppflow::decode_jpeg causes HEAP CORRUPTION error #205

Closed GivenAward closed 2 years ago

GivenAward commented 2 years ago

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);
}