[英]Keras multi_gpu_model error: "swig/python detected a memory leak of type 'int64_t *', no destructor found"
I am using tensorflow 1.5.0, tensorflow-gpu 1.3.0, keras 2.0.9, keras-gpu 2.1.4我正在使用 tensorflow 1.5.0、tensorflow-gpu 1.3.0、keras 2.0.9、keras-gpu 2.1.4
I created my model using this code:我使用以下代码创建了我的模型:
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)
I wanted to use two GPUs on my machine.我想在我的机器上使用两个 GPU。 But when I use
但是当我使用
from keras.utils import multi_gpu_model
parallel_model = multi_gpu_model(model, gpus=2)
I get this error:我收到此错误:
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.
Any suggestions?有什么建议?
This is a bug in tensorflow 1.3 .这是tensorflow 1.3 中的一个错误。 The fix has been ported to 1.4 (and later, of course).
该修复程序已移植到 1.4(当然还有更高版本)。 You have
tensorflow
1.5.0, but not tensorflow-gpu
- 1.3.0.您有
tensorflow
1.5.0,但没有tensorflow-gpu
- 1.3.0。 When you run multi_gpu_model
from keras, it's clearly using tensorflow-gpu
ops.当您从 keras 运行
multi_gpu_model
时,它显然使用了tensorflow-gpu
ops。
So you should update tensorflow-gpu
to at least 1.4, the latest version would be even better.所以你应该将
tensorflow-gpu
更新到至少1.4,最新的版本会更好。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.