【问题标题】:Keras multi_gpu_model error: "swig/python detected a memory leak of type 'int64_t *', no destructor found"Keras multi_gpu_model 错误:“swig/python 检测到 'int64_t *' 类型的内存泄漏,未找到析构函数”
【发布时间】:2018-03-03 05:49:33
【问题描述】:

我正在使用 tensorflow 1.5.0、tensorflow-gpu 1.3.0、keras 2.0.9、keras-gpu 2.1.4

我使用以下代码创建了我的模型:

inputs = Input([1,44,44,44])
x = Conv3D(64, (3,3,3), activation='relu', data_format='channels_first')(inputs)
x = Conv3D(16, (3,3,3), activation='relu', data_format='channels_first')(x)
x = Conv3D(1, (3,3,3), activation='relu', data_format='channels_first')(x)
model = Model(inputs=inputs, outputs=x)

我想在我的机器上使用两个 GPU。 但是当我使用

from keras.utils import multi_gpu_model
parallel_model = multi_gpu_model(model, gpus=2)

我收到此错误:

swig/python detected a memory leak of type 'int64_t *', no destructor found.
swig/python detected a memory leak of type 'int64_t *', no destructor found.
swig/python detected a memory leak of type 'int64_t *', no destructor found.

有什么建议吗?

【问题讨论】:

    标签: python tensorflow keras gpu multi-gpu


    【解决方案1】:

    这是 tensorflow 1.3 中的 bugfix 已移植到 1.4(当然还有更高版本)。你有tensorflow 1.5.0,但没有tensorflow-gpu - 1.3.0。当您从 keras 运行 multi_gpu_model 时,它显然在使用 tensorflow-gpu ops。

    所以你应该将tensorflow-gpu至少更新到1.4,最新的版本会更好。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-03-23
      • 2011-07-14
      • 2010-10-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-12-12
      • 2012-07-16
      相关资源
      最近更新 更多