简体   繁体   English

Tensorflow m1 Mac 多个默认 OpKernel 注册匹配 NodeDef '{{node ZerosLike}}'

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

I'm getting this error on m1 Mac when I run model.predict()当我运行model.predict()时,我在 m1 Mac 上收到此错误

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]多个默认 OpKernel 注册匹配 NodeDef '{{node ZerosLike}}': 'op: "ZerosLike" device_type: "DEFAULT" constraint { name: "T" allowed_values { list { type: DT_INT32 } } } host_memory_arg: "y"' 和'op: "ZerosLike" device_type: "DEFAULT" 约束 { name: "T" allowed_values { list { type: DT_INT32 } } } host_memory_arg: "y"' [Op:ZerosLike]

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按照https://betterprogramming.pub/installing-tensorflow-on-apple-m1-with-new-metal-plugin-6d3cb9cb00ca的“4. Kernel dies whenfitting the model”一节中的说明解决了这个问题

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奇迹般有效

我通过卸载 tensorflow-metal 解决了这个问题

pip uninstall tensorflow-metal

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用 directml 时出错“多个 OpKernel 注册以相同的优先级匹配 NodeDef” - Error when using directml "Multiple OpKernel registrations match NodeDef at the same priority" tensorflow 在 Mac M1 上崩溃 - tensorflow crashes on Mac M1 在 M1 Mac 上安装 Tensorflow - Installing Tensorflow in M1 Mac 在mac m1上安装Tensorflow - Installing Tensorflow on mac m1 无法在 Mac M1 中安装 tensorflow - Not able to install tensorflow in Mac M1 增加 GPU 负载 Mac M1 Tensorflow - Increase GPU load Mac M1 Tensorflow 无论如何在带有 Apple Silicon(M1、M1 Pro、M1 Max)GPU 的 Mac 中使用 Tensorflow? - Anyway to work with Tensorflow in Mac with Apple Silicon (M1, M1 Pro, M1 Max) GPU? 多个输入不适用于 Tensorflow 2 在 MAC OS M1 上安装 - AttributeError: 'tuple' object 没有属性 'shape' - multiple input does not work on Tensorflow 2 installation on MAC OS M1 - AttributeError: 'tuple' object has no attribute 'shape' [Apple M1]:我没有为与节点 {{node RngReadAndSkip}} 兼容的“GPU”设备注册“RngReadAndSkip”OpKernel。 注册:设备=&#39;CPU&#39; - [Apple M1]: I got No registered 'RngReadAndSkip' OpKernel for 'GPU' devices compatible with node {{node RngReadAndSkip}} . Registered: device='CPU' 由于 termcolor 构建不起作用,Tensorflow 安装 M1 Mac 失败 - Tensorflow Installation M1 Mac fails due to termcolor build not working
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM