小编Mar*_*ale的帖子

会话和并行在 TF2.0 中如何工作?

我正在尝试在同一过程中并行运行两个 tensorflow 模型。

在 Tensorflow 1.x 中,我们可以执行Keras Tensorflow - Exception while predicting from multiple threads

graph = tf.Graph()
with graph.as_default():
    session = tf.Session()
    with session.as_default():
        # Create and use the model ...
Run Code Online (Sandbox Code Playgroud)

在 Tensorflow 2.0 中,会话已被删除。

当我尝试在同一个进程中并行运行两个模型时,Tensorflow 崩溃了。TF 2.0 有没有办法解决这个问题?

错误信息:

2019-09-18 16:26:56.978352: E tensorflow/stream_executor/cuda/cuda_blas.cc:238] failed to create cublas handle: CUBLAS_STATUS_NOT_INITIALIZED
2019-09-18 16:26:56.981418: E tensorflow/stream_executor/cuda/cuda_blas.cc:238] failed to create cublas handle: CUBLAS_STATUS_NOT_INITIALIZED
2019-09-18 16:26:56.983202: E tensorflow/stream_executor/cuda/cuda_blas.cc:238] failed to create cublas handle: CUBLAS_STATUS_NOT_INITIALIZED
2019-09-18 16:26:56.985757: E tensorflow/stream_executor/cuda/cuda_blas.cc:238] failed to create cublas …
Run Code Online (Sandbox Code Playgroud)

python tensorflow tf.keras tensorflow2.0

7
推荐指数
1
解决办法
1216
查看次数

标签 统计

python ×1

tensorflow ×1

tensorflow2.0 ×1

tf.keras ×1