我在tensorflow-gpu(GTX1080)上运行以下代码:
data_A = tf.data.Dataset.from_tensor_slices(rainy[:606]) #shape (606, 256, 256, 3), should be abt. 476 MiB
data_B = tf.data.Dataset.from_tensor_slices(sunny) #shape (606, 256, 256, 3), should be abt. 476 MiB
print("size of array in memory: "+ str(sys.getsizeof(sunny)))
dataset = tf.data.Dataset.zip((data_A, data_B))
batched_dataset = dataset.batch(4)
iterator = batched_dataset.make_initializable_iterator()
next_element = iterator.get_next()
print("before initializing iterator")
sess.run(iterator.initializer)
print("after initializing iterator")
从输出中可以看到它在到达最后一条打印行之前没有任何消息崩溃:
2018-01-23 23:04:33.252044: I C:\tf_jenkins\workspace\rel-win\M\windows-gpu\PY\35\tensorflow\core\common_runtime\gpu\gpu_device.cc:1105] Found device 0 with properties:
name: GeForce GTX 1080 major: 6 minor: 1 memoryClockRate(GHz): 1.7715
pciBusID: 0000:01:00.0
totalMemory: 8.00GiB freeMemory: 6.61GiB
2018-01-23 23:04:33.252461: I C:\tf_jenkins\workspace\rel-win\M\windows-gpu\PY\35\tensorflow\core\common_runtime\gpu\gpu_device.cc:1195] Creating TensorFlow device (/device:GPU:0) -> (device: 0, name: GeForce GTX 1080, pci bus id: 0000:01:00.0, compute capability: 6.1)
size of array in memory: 476577936
before initializing iterator
Process finished with exit code -1073740791 (0xC0000409)
编辑:找到以下错误代码:错误代码STATUS_STACK_BUFFER_OVERRUN(0xc0000409)指的是堆栈缓冲区溢出 来自:https://blogs.technet.microsoft.com/srd/2009/01/28/stack-overflow-stack-exhaustion-not-the-same-as-stack-buffer-overflow/