【发布时间】:2020-05-20 00:08:08
【问题描述】:
我已经在 google colab 中训练了我的 TensorFlow 模型,并将其导出为 .h5 格式。在 google colab 中,我可以毫无问题地加载模型,但在我的本地机器上,它会引发错误和警告。
加载模型
import tensorflow as tf
rnn = tf.keras.models.load_model('my_model.h5')
错误
2020-05-16 20:17:10.802390: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU
supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2020-05-16 20:17:10.835907: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU
Frequency: 2400000000 Hz
2020-05-16 20:17:10.836269: I tensorflow/compiler/xla/service/service.cc:168] XLA service
0x4443f90 executing computations on platform Host. Devices:
2020-05-16 20:17:10.836308: I tensorflow/compiler/xla/service/service.cc:175]
StreamExecutor device (0): <undefined>, <undefined>
2020-05-16 20:17:10.862236: W tensorflow/compiler/jit/mark_for_compilation_pass.cc:1412]
(One-time warning): Not using XLA:CPU for cluster because envvar TF_XLA_FLAGS=--
tf_xla_cpu_global_jit was not set. If you want XLA:CPU, either set that envvar, or use
experimental_jit_scope to enable XLA:CPU. To confirm that XLA is active, pass
--vmodule=xla_compilation_cache=1 (as a proper command-line flag, not via TF_XLA_FLAGS) or
set the envvar XLA_FLAGS=--xla_hlo_profile.
我在 google collab 中使用 GPU 训练了模型。
【问题讨论】:
-
这些日志中没有错误。这些都是警告或信息。您应该能够使用您的模型。