我正在尝试在同一过程中并行运行两个 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)