Cannot assign a device for operation ReadVariableOp[2]

Hello, I cannot train with my model on Apple M1 Max. And.I have read more then twenty articles wrote by someone who has similar problem with me, but it ends up didn't work. It shows many similar issue were posted a year ago. Someone replies that this problem is fixed with version 0.5. However, I run 0.6.0 and the problem do exist. I want to know what kind of operations will lead to ReadVariableOp? So I can rewrite my project to avoid ReadVariableOp. I can not find a way to check update list.

I get a error:

2022-11-12 08:18:06.161297: W tensorflow/core/platform/profile_utils/cpu_utils.cc:128] Failed to get CPU frequency: 0 Hz
Epoch 1/100
Traceback (most recent call last):
  File "/Users/xxx/standard_train/train2.py", line 118, in <module>
    model.fit(train_data, epochs=config["train"]["epochs"], validation_data=valid_data, workers=config["train"]["num_workers"],use_multiprocessing=True,callbacks=callbacks)
  File "/Users/xxx/anaconda3/envs/tf/lib/python3.10/site-packages/keras/utils/traceback_utils.py", line 70, in error_handler
    raise e.with_traceback(filtered_tb) from None
  File "/Users/xxx/anaconda3/envs/tf/lib/python3.10/site-packages/tensorflow/python/eager/execute.py", line 54, in quick_execute
    tensors = pywrap_tfe.TFE_Py_Execute(ctx._handle, device_name, op_name,
tensorflow.python.framework.errors_impl.InvalidArgumentError: Cannot assign a device for operation model/conv2d/Conv2D/ReadVariableOp: Could not satisfy explicit device specification '' because the node {{colocation_node model/conv2d/Conv2D/ReadVariableOp}} was colocated with a group of nodes that required incompatible device '/job:localhost/replica:0/task:0/device:GPU:0'. All available devices [/job:localhost/replica:0/task:0/device:CPU:0, /job:localhost/replica:0/task:0/device:GPU:0].
Colocation Debug Info:
Colocation group had the following types and supported devices:
Root Member(assigned_device_name_index_=2 requested_device_name_='/job:localhost/replica:0/task:0/device:GPU:0' assigned_device_name_='/job:localhost/replica:0/task:0/device:GPU:0' resource_device_name_='/job:localhost/replica:0/task:0/device:GPU:0' supported_device_types_=[CPU] possible_devices_=[]
ResourceApplyAdamWithAmsgrad: CPU
ReadVariableOp: GPU CPU
_Arg: GPU CPU

Colocation members, user-requested devices, and framework assigned devices, if any:
  model_conv2d_conv2d_readvariableop_resource (_Arg)  framework assigned device=/job:localhost/replica:0/task:0/device:GPU:0
  adam_adam_update_resourceapplyadamwithamsgrad_m (_Arg)  framework assigned device=/job:localhost/replica:0/task:0/device:GPU:0
  adam_adam_update_resourceapplyadamwithamsgrad_v (_Arg)  framework assigned device=/job:localhost/replica:0/task:0/device:GPU:0
  adam_adam_update_resourceapplyadamwithamsgrad_vhat (_Arg)  framework assigned device=/job:localhost/replica:0/task:0/device:GPU:0
  model/conv2d/Conv2D/ReadVariableOp (ReadVariableOp)
  Adam/Adam/update/ResourceApplyAdamWithAmsgrad (ResourceApplyAdamWithAmsgrad) /job:localhost/replica:0/task:0/device:GPU:0
Cannot assign a device for operation ReadVariableOp[2]
 
 
Q