-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tensorflow metal on M4 Pro #30
Comments
michaelobrien@mini08s-Mini src % python3 version (venv-metal) michaelobrien@mini08s-Mini src % python -m pip list absl-py 2.1.0 136 python -m pip uninstall tensorflow-metal (venv-metal) michaelobrien@mini08s-Mini src % python -c "import tensorflow as tf; print(tf.version)" A module that was compiled using NumPy 1.x cannot be run in If you are a user of the module, the easiest solution will be to numpy revert from 2.0.2 to 1.24.1 (m1max) (venv-metal) michaelobrien@mini08s-Mini src % python -m pip uninstall numpy (venv-metal) michaelobrien@mini08s-Mini src % python -c "import tensorflow as tf; print(tf.version)" |
partially working (venv-metal) michaelobrien@mini08s-Mini src % python tflow.py Colocation members, user-requested devices, and framework assigned devices, if any: 2024-11-17 14:40:55.567733: W tensorflow/core/common_runtime/colocation_graph.cc:1213] Failed to place the graph without changing the devices of some resources. Some of the operations (that had to be colocated with resource generating operations) are not supported on the resources' devices. Current candidate devices are [ Colocation members, user-requested devices, and framework assigned devices, if any: 2024-11-17 14:40:55.567853: W tensorflow/core/common_runtime/colocation_graph.cc:1213] Failed to place the graph without changing the devices of some resources. Some of the operations (that had to be colocated with resource generating operations) are not supported on the resources' devices. Current candidate devices are [ Colocation members, user-requested devices, and framework assigned devices, if any: |
fix remove
|
(venv-metal) michaelobrien@mini08s-Mini src % python tflow.py import tensorflow as tf https://www.tensorflow.org/guide/distributed_traininghttps://www.tensorflow.org/tutorials/distribute/kerashttps://keras.io/guides/distributed_training/#strategy = tf.distribute.MirroredStrategy() #NUM_GPUS = 2 working on dual RTX-4090#strategy = tf.distribute.MirroredStrategy(devices=["/gpu:0", "/gpu:1"]) strategy = tf.distribute.OneDeviceStrategy(device="/gpu") #central_storage_strategy = tf.distribute.experimental.CentralStorageStrategy() #print('Number of devices: {}'.format(strategy.num_replicas_in_sync)) https://learn.microsoft.com/en-us/windows/ai/directml/gpu-faq#a = tf.constant([1.]) #gpu_config = tf.GPUOptions() #session = tf.Session(config=tf.ConfigProto(gpu_options=gpu_config)) cifar = tf.keras.datasets.cifar100 with strategy.scope(): https://www.tensorflow.org/api_docs/python/tf/keras/applications/resnet50/ResNet50https://keras.io/api/models/model/parallel_model = tf.keras.applications.ResNet50( https://saturncloud.io/blog/how-to-do-multigpu-training-with-keras/#parallel_model = multi_gpu_model(model, gpus=2) https://keras.io/api/models/model_training_apis/parallel_model.compile(optimizer="adam", loss=loss_fn, metrics=["accuracy"]) |
M1 pro 6/2/14 example
|
Issues with tensorflow version
https://developer.apple.com/metal/tensorflow-plugin/
The text was updated successfully, but these errors were encountered: