【问题标题】:Different results on different machines tensorflow不同机器上的不同结果
【发布时间】:2021-08-21 07:26:42
【问题描述】:

我正在运行 Tensorflow 1.12 代码(我没有使用 GPU)。我已经设置了

import os
os.environ['TF_DETERMINISTIC_OPS'] = '1'
os.environ['TF_CUDNN_DETERMINISTIC'] = '1'
os.environ['PYTHONHASHSEED'] = '42'

import tensorflow as tf
tf.reset_default_graph()
session_conf = tf.ConfigProto(
    intra_op_parallelism_threads=1, 
    inter_op_parallelism_threads=1)
np.random.seed(42)
tf.set_random_seed(42)

<<my code>>

如果我在相同的硬件上运行代码,结果是相同的。但是,如果我在不同的硬件上运行代码(例如 Xeon E5 与 Epyc Rome 7402),我会得到不同的结果。

你能帮我解决这个问题吗? 非常感谢您!

【问题讨论】:

    标签: python tensorflow reproducible-research


    【解决方案1】:

    Tensorflow 性能也有点依赖于硬件配置。

    TensorFlow Serving 的性能高度依赖于 它运行的应用程序、部署它的环境和其他 与之共享底层硬件访问权限的软件 资源。

    阅读更多来自:https://www.tensorflow.org/tfx/serving/performance

    【讨论】:

    • 感谢您的评论。那么,从技术上讲,没有办法让 tensorflow 模型可重现?
    猜你喜欢
    • 2019-07-08
    • 1970-01-01
    • 1970-01-01
    • 2018-03-27
    • 2020-09-17
    • 1970-01-01
    • 1970-01-01
    • 2021-10-07
    • 2016-11-08
    相关资源
    最近更新 更多