serizba / cppflow

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

cppflow model prediction by gpu #155

Closed Fansomone closed 3 years ago

Fansomone commented 3 years ago

My model (h5 format) can be predicted using GPU, but when I convert it to pb format, I can't call GPU to predict using CppFlow. What should I do?

I set up the following configuration in the model.py file os.environ["CUDA_VISIBLE_DEVICES"] = "0"

ljn917 commented 3 years ago

Cppflow (libtensorflow to be exact) automatically uses your GPU if it is available. Please check the error logs to see if you have incompatible driver/cudatookit.

You can try export CUDA_VISIBLE_DEVICES=0, but it is often not necessary.

Fansomone commented 3 years ago

thanks a lot,my problem has been solved