java icon indicating copy to clipboard operation
java copied to clipboard

Could tensorflow-java invoke GPU?

Open mullerhai opened this issue 3 years ago • 6 comments

Hi: when I train the model build with tensorflow-java ,only can use cpu,but if I want to use GPU,I don't the deal method.is it support GPU?

mullerhai avatar Jun 03 '22 08:06 mullerhai

Switch tensorflow-core-platform-gpu for your current OS specific platform jar on your classpath and it will default to running on the GPU.

Craigacp avatar Jun 03 '22 13:06 Craigacp

Switch tensorflow-core-platform-gpu for your current OS specific platform jar on your classpath and it will default to running on the GPU.

get it,thanks

mullerhai avatar Jun 03 '22 13:06 mullerhai

Switch tensorflow-core-platform-gpu for your current OS specific platform jar on your classpath and it will default to running on the GPU.

in the java/scala tensorflow-java code,how to assign gpu train tensorflow model? could we give some example ?

mullerhai avatar Jun 03 '22 13:06 mullerhai

The TF runtime prefers to place computations on the GPU, so if one is available it will use it in preference to the CPU.

Craigacp avatar Jun 03 '22 14:06 Craigacp

The TF runtime prefers to place computations on the GPU, so if one is available it will use it in preference to the CPU.

Does it support mac bookpro intel gpu ?

mullerhai avatar Jun 03 '22 14:06 mullerhai

No. TF doesn't support that. There is some minimal support for Intel's integrated GPUs via Microsoft's DirectML on Windows in TF, but I wouldn't expect that to work particularly well. Tensorflow for Metal doesn't support Intel GPUs (https://developer.apple.com/metal/tensorflow-plugin/), and if it did I'm not sure we actually expose the hook to load in that device.

Craigacp avatar Jun 03 '22 15:06 Craigacp