tensorflow: NOT_FOUND: could not find registered platform with id

Click to expand!

Issue Type

Bug

Source

source

Tensorflow Version

tf 2.11.0

Custom Code

Yes

OS Platform and Distribution

MacOS Ventura

Mobile device

No response

Python version

3.10

Bazel version

No response

GCC/Compiler version

12.2.0

CUDA/cuDNN version

NA

GPU model and memory

M1 Mac, 8 GB

Current Behaviour?

2022-12-23 01:31:15.756543: I tensorflow/core/grappler/optimizers/custom_graph_optimizer_registry.cc:114] Plugin optimizer for device_type GPU is enabled.
2022-12-23 01:31:17.330784: 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: 0x12ff97980


Error:
                             Traceback (most recent call last)
Cell In[42], line 1
----> 1 hist = model.fit(train, epochs=20, validation_data=val, callbacks=[tensorboard_callback])

File /opt/homebrew/lib/python3.10/site-packages/keras/utils/traceback_utils.py:70, in filter_traceback.<locals>.error_handler(*args, **kwargs)
     67     filtered_tb = _process_traceback_frames(e.__traceback__)
     68     # To get the full stack trace, call:
     69     # `tf.debugging.disable_traceback_filtering()`
---> 70     raise e.with_traceback(filtered_tb) from None
     71 finally:
     72     del filtered_tb

File /opt/homebrew/lib/python3.10/site-packages/tensorflow/python/eager/execute.py:52, in quick_execute(op_name, num_outputs, inputs, attrs, ctx, name)
     50 try:
     51   ctx.ensure_initialized()
---> 52   tensors = pywrap_tfe.TFE_Py_Execute(ctx._handle, device_name, op_name,
     53                                       inputs, attrs, num_outputs)
     54 except core._NotOkStatusException as e:
     55   if name is not None:

NotFoundError: Graph execution error:

Standalone code to reproduce the issue

[Link to pdf](https://github.com/nicknochnack/ImageClassification/blob/main/Getting%20Started.ipynb)

The code and files needed are same required here

Relevant log output

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 18 (2 by maintainers)

Most upvoted comments

@beyarkay ,

I personally tested the following code with latest tensorflow-macos and encountered the reported error.

import tensorflow as tf

cifar = tf.keras.datasets.cifar100
(x_train, y_train), (x_test, y_test) = cifar.load_data()
model = tf.keras.applications.ResNet50(
    include_top=True,
    weights=None,
    input_shape=(32, 32, 3),
    classes=100,)

loss_fn = tf.keras.losses.SparseCategoricalCrossentropy(from_logits=True)
model.compile(optimizer="adam", loss=loss_fn, metrics=["accuracy"])
model.fit(x_train, y_train, epochs=5, batch_size=64)

I have changed the optimizer to legacy version by changing the model.compile() like below and its working with latest version also.

model.compile(optimizer=tf.keras.optimizers.legacy.Adam(), loss=loss_fn, metrics=["accuracy"])

Please refer to attached log below.

# Testing tensorflow-macos(2.11v).txt

Yes, tensorflow-macos is maintained by Apple and this issue might be fixed by them. But I believe this issue already under their attention and efforts are also in place from our side to fix the issue at earliest.Till then the above recommendation shall work fine.

Hi @mohantym, The data folder is in the repo. Kindly find the data folder attached there.

Thanks for this, you are absolutely correct, the only way I could get TF2 to run on my new M1 MacStudio is by installing the versions you mention. But my enthusiasm quickly waned when I benchmarked a fairly simple neural network using Keras: Exec time on an old Intel core i5 iMac (cpu only): 13 min Exec time on a brand new tricked out M1 MacStudio (activity monitor confirmed that GPU was running at close to 100% the whole time): 106 min So either I’m doing something very wrong (exact same python script) or these libraries, tho functional, are seriously faulty.