Tensorflow m1 Mac Multiple Default OpKernel registrations match NodeDef '{{node ZerosLike}}'

Viewed 172

I'm getting this error on m1 Mac when I run model.predict()

Multiple Default OpKernel registrations match NodeDef '{{node ZerosLike}}': 'op: "ZerosLike" device_type: "DEFAULT" constraint { name: "T" allowed_values { list { type: DT_INT32 } } } host_memory_arg: "y"' and 'op: "ZerosLike" device_type: "DEFAULT" constraint { name: "T" allowed_values { list { type: DT_INT32 } } } host_memory_arg: "y"' [Op:ZerosLike]

2 Answers

I had the same error.

Fixed the problem by following the instructions in section "4. Kernel dies when fitting the model" at https://betterprogramming.pub/installing-tensorflow-on-apple-m1-with-new-metal-plugin-6d3cb9cb00ca

pip uninstall tensorflow-metal
conda deactivate <current env>
conda create --name tensorflow_m1 python==3.9
conda activate tensorflow_m1
conda install -c apple tensorflow-deps==2.8
pip install tensorflow-macos==2.8
pip install tensorflow-macos==2.8 --no-dependencies
pip install tensorflow-metal==0.4.0

works like a charm

I fixed this by uninstalling tensorflow-metal

pip uninstall tensorflow-metal
Related