我使用Tensorflow和Keras创建了一个泊坞窗图像,当我创建一个容器时,它工作正常但仅限第一次。我第二次尝试运行相同的代码时出现错误:
class A
after_commit :a, :b, :c, :d, :e, on: [:create, :update]
def a
end
def b
end
def c
end
def d
end
def e
end
end
我认为这与会话和内存泄露有关,但我不知道如何解决它。每次我必须删除容器并创建一个新容器只是为了运行一个文件。
代码:
2017-10-04 13:57:25.359384: I tensorflow/core/common_runtime/bfc_allocator.cc:660] Bin for 1.12MiB was 1.00MiB, Chunk State:
2017-10-04 13:57:25.359402: I tensorflow/core/common_runtime/bfc_allocator.cc:678] Chunk at 0x1041ac00000 of size 1280
2017-10-04 13:57:25.359420: I tensorflow/core/common_runtime/bfc_allocator.cc:678] Chunk at 0x1041ac00500 of size 256
2017-10-04 13:57:25.359435: I tensorflow/core/common_runtime/bfc_allocator.cc:678] Chunk at 0x1041ac00600 of size 256
2017-10-04 13:57:25.359463: I tensorflow/core/common_runtime/bfc_allocator.cc:678] Chunk at 0x1041ac00700 of size 256
2017-10-04 13:57:25.359478: I tensorflow/core/common_runtime/bfc_allocator.cc:678] Chunk at 0x1041ac00800 of size 256
2017-10-04 13:57:25.359492: I tensorflow/core/common_runtime/bfc_allocator.cc:678] Chunk at 0x1041ac00900 of size 512
2017-10-04 13:57:25.359507: I tensorflow/core/common_runtime/bfc_allocator.cc:678] Chunk at 0x1041ac00b00 of size 256
2017-10-04 13:57:25.359521: I tensorflow/core/common_runtime/bfc_allocator.cc:678] Chunk at 0x1041ac00c00 of size 256
2017-10-04 13:57:25.359538: I tensorflow/core/common_runtime/bfc_allocator.cc:678] Chunk at 0x1041ac00d00 of size 1024
2017-10-04 13:57:25.359551: I tensorflow/core/common_runtime/bfc_allocator.cc:678] Chunk at 0x1041ac01100 of size 256
2017-10-04 13:57:25.359565: I tensorflow/core/common_runtime/bfc_allocator.cc:678] Chunk at 0x1041ac01200 of size 256
2017-10-04 13:57:25.359581: I tensorflow/core/common_runtime/bfc_allocator.cc:678] Chunk at 0x1041ac01300 of size 2048
2017-10-04 13:57:25.359595: I tensorflow/core/common_runtime/bfc_allocator.cc:678] Chunk at 0x1041ac01b00 of size 256
2017-10-04 13:57:25.359608: I tensorflow/core/common_runtime/bfc_allocator.cc:678] Chunk at 0x1041ac01c00 of size 256
2017-10-04 13:57:25.359624: I tensorflow/core/common_runtime/bfc_allocator.cc:678] Chunk at 0x1041ac01d00 of size 256
2017-10-04 13:57:25.359638: I tensorflow/core/common_runtime/bfc_allocator.cc:678] Chunk at 0x1041ac01e00 of size 256
2017-10-04 13:57:25.359653: I tensorflow/core/common_runtime/bfc_allocator.cc:678] Chunk at 0x1041ac01f00 of size 256
2017-10-04 13:57:25.359666: I tensorflow/core/common_runtime/bfc_allocator.cc:678] Chunk at 0x1041ac02000 of size 256
2017-10-04 13:57:25.359679: I tensorflow/core/common_runtime/bfc_allocator.cc:678] Chunk at 0x1041ac02100 of size 256
2017-10-04 13:57:25.359695: I tensorflow/core/common_runtime/bfc_allocator.cc:678] Chunk at 0x1041ac02200 of size 256
2017-10-04 13:57:25.359708: I tensorflow/core/common_runtime/bfc_allocator.cc:678] Chunk at 0x1041ac02300 of size 256
2017-10-04 13:57:25.359722: I tensorflow/core/common_runtime/bfc_allocator.cc:678] Chunk at 0x1041ac03f00 of size 256
2017-10-04 13:57:25.359736: I tensorflow/core/common_runtime/bfc_allocator.cc:678] Chunk at 0x1041ac28000 of size 256
2017-10-04 13:57:25.359749: I tensorflow/core/common_runtime/bfc_allocator.cc:678] Chunk at 0x1041ac70100 of size 512
2017-10-04 13:57:25.359765: I tensorflow/core/common_runtime/bfc_allocator.cc:678] Chunk at 0x1041ad00300 of size 512
2017-10-04 13:57:25.359780: I tensorflow/core/common_runtime/bfc_allocator.cc:678] Chunk at 0x1041ad00500 of size 1179648
2017-10-04 13:57:25.359793: I tensorflow/core/common_runtime/bfc_allocator.cc:678] Chunk at 0x1041ae20500 of size 1024
2017-10-04 13:57:25.359807: I tensorflow/core/common_runtime/bfc_allocator.cc:678] Chunk at 0x1041ae20900 of size 3405568
2017-10-04 13:57:25.359821: I tensorflow/core/common_runtime/bfc_allocator.cc:687] Free at 0x1041ac02400 of size 6912
2017-10-04 13:57:25.359835: I tensorflow/core/common_runtime/bfc_allocator.cc:687] Free at 0x1041ac04000 of size 147456
2017-10-04 13:57:25.359849: I tensorflow/core/common_runtime/bfc_allocator.cc:687] Free at 0x1041ac28100 of size 294912
2017-10-04 13:57:25.359863: I tensorflow/core/common_runtime/bfc_allocator.cc:687] Free at 0x1041ac70300 of size 589824
2017-10-04 13:57:25.359878: I tensorflow/core/common_runtime/bfc_allocator.cc:693] Summary of in-use Chunks by size:
2017-10-04 13:57:25.359896: I tensorflow/core/common_runtime/bfc_allocator.cc:696] 19 Chunks of size 256 totalling 4.8KiB
2017-10-04 13:57:25.359913: I tensorflow/core/common_runtime/bfc_allocator.cc:696] 3 Chunks of size 512 totalling 1.5KiB
2017-10-04 13:57:25.359929: I tensorflow/core/common_runtime/bfc_allocator.cc:696] 2 Chunks of size 1024 totalling 2.0KiB
2017-10-04 13:57:25.359944: I tensorflow/core/common_runtime/bfc_allocator.cc:696] 1 Chunks of size 1280 totalling 1.2KiB
2017-10-04 13:57:25.359960: I tensorflow/core/common_runtime/bfc_allocator.cc:696] 1 Chunks of size 2048 totalling 2.0KiB
2017-10-04 13:57:25.359976: I tensorflow/core/common_runtime/bfc_allocator.cc:696] 1 Chunks of size 1179648 totalling 1.12MiB
2017-10-04 13:57:25.359992: I tensorflow/core/common_runtime/bfc_allocator.cc:696] 1 Chunks of size 3405568 totalling 3.25MiB
2017-10-04 13:57:25.360007: I tensorflow/core/common_runtime/bfc_allocator.cc:700] Sum Total of in-use chunks: 4.38MiB
2017-10-04 13:57:25.360028: I tensorflow/core/common_runtime/bfc_allocator.cc:702] Stats:
Limit: 5636096
InUse: 4596992
MaxInUse: 5636096
NumAllocs: 32
MaxAllocSize: 3405568
2017-10-04 13:57:25.360052: W tensorflow/core/common_runtime/bfc_allocator.cc:277] *_*_____*_________****************************************************************xxxxxxxxxxxxxxxxxx
2017-10-04 13:57:25.360084: W tensorflow/core/framework/op_kernel.cc:1192] Resource exhausted: OOM when allocating tensor with shape[3,3,128,256]