tensorflow tf.while_loop segmentation error when parallel_iterations=0 -


i'm wondering why tf.while_loop gives segmentation error when run below code while setting parallel_iterations=0, works fine long >0. there reason ?

import tensorflow tf                                                                                                                                                                         import numpy np                                                                                                                                                                               = tf.constant(0)                                                                                                                                                                              s = tf.constant(0)                                                                                                                                                                              x = tf.random_uniform([], 0, 761-64, dtype=tf.int32)                                                                                                                                            p = tf.print(x, [x], message="this random x: ")                                                                                                                                              # rand = tf.random                                                                                                                                                                              c = lambda i,s,x,p: tf.less(i, 50)                                                                                                                                                              b = lambda i,s,x,p: (tf.add(i, 1), tf.add(s, x),tf.random_uniform([], 0,                                                                                                                            761-64, dtype=tf.int32),tf.print(x, [x], message="this random x: "))                                                                                                                     r = tf.while_loop(c, b, [i,s,x,p], parallel_iterations=1)                                                                                                                                        sess = tf.session()                                                                                                                                                                             init = tf.initialize_all_variables().run                                                                                                                                                        print sess.run(r) 

the error looks follows: tensorflow/stream_executor/dso_loader.cc:108] opened cuda library libcublas.so locally tensorflow/stream_executor/dso_loader.cc:108] opened cuda library libcudnn.so.4 locally tensorflow/stream_executor/dso_loader.cc:108] opened cuda library libcufft.so locally tensorflow/stream_executor/dso_loader.cc:108] opened cuda library libcuda.so.1 locally tensorflow/stream_executor/dso_loader.cc:108] opened cuda library libcurand.so locally tensorflow/core/common_runtime/gpu/gpu_init.cc:102] found device 0 properties: name: geforce gtx titan x major: 5 minor: 2 memoryclockrate (ghz) 1.076 pcibusid 0000:04:00.0 total memory: 11.92gib free memory: 11.81gib tensorflow/core/common_runtime/gpu/gpu_init.cc:126] dma: 0 tensorflow/core/common_runtime/gpu/gpu_init.cc:136] 0: y tensorflow/core/common_runtime/gpu/gpu_device.cc:806] creating tensorflow device (/gpu:0) -> (device: 0, name: geforce gtx titan x, pci bus id: 0000:04:00.0) segmentation fault (core dumped)

why segmentation fault occur ?


Comments

Popular posts from this blog

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -