问题1:
ValueError: Cannot create a tensor proto whose content is larger than 2GB.
解决方法:利用placeholder以及assign方法。参考
import tensorflow as tf
import numpy as np
w_init = np.random.randn(2**22, 256).astype(np.float32)
w_plhdr = tf.placeholder(dtype=tf.float32, shape=[2**22, 256])
w = tf.get_variable('w', [2**22, 256])
with tf.Session() as sess:
sess.run(tf.global_variables_initializer())
sess.run(w.assign(w_plhdr), {w_plhdr: w_init})
print sess.run(tf.reduce_sum(w))