Closed weixiaokuan11 closed 1 year ago
This has been fixed with TF 2.13 (due to be on CRAN in about a week).
This should be all that's needed to get everything working on an M2 Mac now:
remotes::install_github("rstudio/tensorflow")
reticulate::install_python()
tensorflow::install_tensorflow()
I am using MacOS M2 build. By using the approaches provided in this thread. I can install tensorflow and it seems to be working but it(keras) cannot be used to fit the model. The codes and errors are as the below. I have been researching this for a while and cannot find a solution. Can someone share some insights into this issue? Thank you. -Xiaokuan
2023-03-28 18:37:13.766399: W tensorflow/tsl/platform/profile_utils/cpu_utils.cc:128] Failed to get CPU frequency: 0 Hz Epoch 1/30 2023-03-28 18:37:13.947807: I tensorflow/core/grappler/optimizers/custom_graph_optimizer_registry.cc:114] Plugin optimizer for device_type GPU is enabled. 2023-03-28 18:37:14.073945: W tensorflow/core/framework/op_kernel.cc:1830] OP_REQUIRES failed at xla_ops.cc:418 : NOT_FOUND: could not find registered platform with id: 0x280147c70 2023-03-28 18:37:14.073973: W tensorflow/core/framework/op_kernel.cc:1830] OP_REQUIRES failed at xla_ops.cc:418 : NOT_FOUND: could not find registered platform with id: 0x280147c70 2023-03-28 18:37:14.088151: W tensorflow/core/framework/op_kernel.cc:1830] OP_REQUIRES failed at xla_ops.cc:418 : NOT_FOUND: could not find registered platform with id: 0x280147c70 2023-03-28 18:37:14.089599: W tensorflow/core/framework/op_kernel.cc:1830] OP_REQUIRES failed at xla_ops.cc:418 : NOT_FOUND: could not find registered platform with id: 0x280147c70 2023-03-28 18:37:14.098454: W tensorflow/core/framework/op_kernel.cc:1830] OP_REQUIRES failed at xla_ops.cc:418 : NOT_FOUND: could not find registered platform with id: 0x280147c70 2023-03-28 18:37:14.098472: W tensorflow/core/framework/op_kernel.cc:1830] OP_REQUIRES failed at xla_ops.cc:418 : NOT_FOUND: could not find registered platform with id: 0x280147c70 Error in py_call_impl(callable, dots$args, dots$keywords) : tensorflow.python.framework.errors_impl.NotFoundError: Graph execution error:
<... omitted ...>on3.8/site-packages/keras/optimizers/optimizer_experimental/optimizer.py", line 1166, in _internal_apply_gradients return tf.internal.distribute.interim.maybe_merge_call( File "/Users/roger/Library/r-miniconda-arm64/envs/r-reticulate/lib/python3.8/site-packages/keras/optimizers/optimizer_experimental/optimizer.py", line 1216, in _distributed_apply_gradients_fn distribution.extended.update( File "/Users/roger/Library/r-miniconda-arm64/envs/r-reticulate/lib/python3.8/site-packages/keras/optimizers/optimizer_experimental/optimizer.py", line 1211, in apply_grad_to_update_var return self._update_step_xla(grad, var, id(self._var_key(var))) Node: 'StatefulPartitionedCall_4' could not find registered platform with id: 0x280147c70 [[{{node StatefulPartitionedCall_4}}]] [Op:__inference_train_function_854] See
reticulate::py_last_error()
for details