[英]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.