m1使用tensorflow遇到的问题
发布时间
阅读量:
阅读量
m1使用tensorflow遇到的问题
2021-10-13 17:04:20.629210: I tensorflow/compiler/mlir/mlir_graph_optimization_pass.cc:116] None of the MLIR optimization passes are enabled (registered 2)
2021-10-13 17:04:20.629440: W tensorflow/core/platform/profile_utils/cpu_utils.cc:126] Failed to get CPU frequency: 0 Hz
2021-10-13 17:04:20.630210: F tensorflow/core/grappler/costs/op_level_cost_estimator.cc:710] Check failed: 0 < gflops (0 vs. 0)type: "CPU"
model: "0"
num_cores: 8
environment {
key: "cpu_instruction_set"
value: "ARM NEON"
}
environment {
key: "eigen"
value: "3.3.90"
}
l1_cache_size: 16384
l2_cache_size: 524288
l3_cache_size: 524288
memory_size: 268435456
Process finished with exit code 134 (interrupted by signal 6: SIGABRT)
解决方案
- 前往链接 https://github.com/Enriqueliu/tensorflow_macos
- 下载仓库,终端运行脚本download_and_install.sh
./download_and_install.sh
-
使用pycharm导入下载安装好的python3

- 运行代码,使用ML Compute框架计算也是非常快的
/Users/enriqueleo/tensorflow_macos_venv/bin/python3 /Users/enriqueleo/PycharmProjects/tensorflow/main.py
2021-10-13 17:15:48.518614: I tensorflow/compiler/mlir/mlir_graph_optimization_pass.cc:116] None of the MLIR optimization passes are enabled (registered 2)
2021-10-13 17:15:48.519757: W tensorflow/core/platform/profile_utils/cpu_utils.cc:126] Failed to get CPU frequency: 0 Hz
Epoch 1/10
WARNING:tensorflow:AutoGraph could not transform <function Model.make_train_function.<locals>.train_function at 0x10e42dca0> and will run it as-is.
Please report this to the TensorFlow team. When filing the bug, set the verbosity to 10 (on Linux, `export AUTOGRAPH_VERBOSITY=10`) and attach the full output.
Cause: unsupported operand type(s) for -: 'NoneType' and 'int'
To silence this warning, decorate the function with @tf.autograph.experimental.do_not_convert
1875/1875 [==============================] - 1s 340us/step - loss: 2.3620 - accuracy: 0.0992
Epoch 2/10
1875/1875 [==============================] - 1s 329us/step - loss: 2.3619 - accuracy: 0.0992
Epoch 3/10
1875/1875 [==============================] - 1s 331us/step - loss: 2.3607 - accuracy: 0.1004
Epoch 4/10
1875/1875 [==============================] - 1s 329us/step - loss: 2.3616 - accuracy: 0.0995
Epoch 5/10
1875/1875 [==============================] - 1s 329us/step - loss: 2.3600 - accuracy: 0.1011
Epoch 6/10
1875/1875 [==============================] - 1s 329us/step - loss: 2.3605 - accuracy: 0.1007
Epoch 7/10
1875/1875 [==============================] - 1s 329us/step - loss: 2.3599 - accuracy: 0.1012
Epoch 8/10
1875/1875 [==============================] - 1s 328us/step - loss: 2.3619 - accuracy: 0.0993
Epoch 9/10
1875/1875 [==============================] - 1s 337us/step - loss: 2.3613 - accuracy: 0.0999
Epoch 10/10
1875/1875 [==============================] - 1s 329us/step - loss: 2.3602 - accuracy: 0.1010
Process finished with exit code 0
全部评论 (0)
还没有任何评论哟~
