mercredi 29 août 2018

Tensorflow v1.10.1 NewSession() error: Not found: No session factory registered for the given session options

  • Tensorflow version: 1.10.1
  • Language: C++
  • Compiled using: cmake

We have created a frozen_graph.pb and are using tensorflow C++ api to import. The error we run into every time we execute our code is the following: NewSession() error: Not found: No session factory registered for the given session options: {target: "" config: gpu_options { per_process_gpu_memory_fraction: 1 allow_growth: true }} Registered factories are {}.

In the following snippet:

// Declaring a tensorflow session
Session* session;
void* error = NULL;

// Declaring Session options
SessionOptions options;

//options.config.set_allow_soft_placement(true);
options.config.mutable_gpu_options()->set_allow_growth(true);

// To control fraction of GPU used
options.config.mutable_gpu_options()->set_per_process_gpu_memory_fraction(perProcessGpuMemoryFraction);

// Starting a new session and checking to see the session has been created without errors
Status status = NewSession(options, &session);
if (!status.ok()) {
    std::cout << "NewSession() error: " << status.ToString() << "\n";
    return error;
}

we have tried adding -Wl,-whole-archive libtensorflow_cc.so -Wl,--no-whole-archive, still getting the same error. Also tried -Wl,--allow-multiple-definition libtensorflow_cc.so -Wl,--no-whole-archive, still getting the same error.

Please suggest a solution.

Aucun commentaire:

Enregistrer un commentaire