gpt4 book ai didi

python - Keras multi_gpu_model 错误 : "swig/python detected a memory leak of type ' int64_t *', no destructor found"

转载 作者:太空宇宙 更新时间:2023-11-04 04:47:58 24 4
gpt4 key购买 nike

我正在使用 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.

有什么建议吗?

最佳答案

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

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

关于python - Keras multi_gpu_model 错误 : "swig/python detected a memory leak of type ' int64_t *', no destructor found",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49081129/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com