GithubHelp home page GithubHelp logo

Comments (3)

nehbit avatar nehbit commented on May 24, 2024 1

Thank you! I had done that already, and the GPU still did not show up as an available backend. However once I started running something, I managed to confirm the GPU is working because I can see the GPU being used from Activity Monitor.

It's probably prudent to note for future viewers that this is the case, and that TF behaves exactly like it would be using CPU only, even while GPU is in fact being used. I suspect once this is merged into the main branch the behaviour will improve.

I'm getting basically zero performance benefit by using GPU over CPU, but there's already an issue to track that: #7.

from tensorflow_macos.

nehbit avatar nehbit commented on May 24, 2024

Did you manage to get this working? I'm having the same issue with my Macbook Pro. The graphics card is AMD Radeon R9 M370X.

from tensorflow_macos.

dkgaraujo avatar dkgaraujo commented on May 24, 2024

Did you manage to get this working? I'm having the same issue with my Macbook Pro. The graphics card is AMD Radeon R9 M370X.

Hi nehbit, yes I did. It turns out that MLCompute will sort of automatically choose the best device for your specific setting. And if you read way down the README file, they mention that you can hard-code which device (CPU or GPU) will be used. So I hard-coded the GPU and it worked. The ways you can do this follow below in both python and R are below:

# python
import tensorflow as tf
from tensorflow.python.compiler.mlcompute import mlcompute
mlcompute.set_mlc_device(device_name = 'gpu')

# your amazing neural network model follows...
# R
reticulate::use_virtualenv(virtualenv = "~/tensorflow_macos_venv/", required = TRUE)
library(keras)
mlcompute <- reticulate::import("tensorflow.python.compiler.mlcompute")
mlcompute$set_mlc_device(device_name = "gpu")

# your amazing neural network model follows...

from tensorflow_macos.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.