Tensorflow feed_dict with tensorflow.python.framework.errors.InvalidArgumentError
Question: my example is like the following:

    
    
    import tensorflow as tf
    import numpy as np
    
    
    batch_size = 10
    real_data = np.ndarray(shape=(batch_size, 1), dtype=np.int32)
    for i in range(batch_size):
        real_data[i] = i
    print np.shape(real_data)
    
    holder = tf.placeholder(tf.int32, shape=[None, 1])
    
    with tf.Session() as sess:
        feed_dict = {
            holder: real_data
        }
        sess.run([], feed_dict=feed_dict)
    

The out put is like following:

    
    
    /home/att/anaconda2/bin/python /home/att/文档/code/justtest/ates.py
    (10, 1)
    Traceback (most recent call last):
      File "/home/att/文档/code/justtest/ates.py", line 17, in <module>
        sess.run([], feed_dict=feed_dict)
      File "/home/att/anaconda2/lib/python2.7/site-packages/tensorflow/python/client/ session.py", line 340, in run
        run_metadata_ptr)
      File "/home/att/anaconda2/lib/python2.7/site-packages/tensorflow/python/client/ session.py", line 564, in _run
        feed_dict_string, options, run_metadata)
      File "/home/att/anaconda2/lib/python2.7/site-packages/tensorflow/python/client/ session.py", line 637, in _do_run
        target_list, options, run_metadata)
      File "/home/att/anaconda2/lib/python2.7/site-packages/tensorflow/python/client/ session.py", line 659, in _do_call
        e.code)
    tensorflow.python.framework.errors.InvalidArgumentError
    
    Process finished with exit code 1
    

What confuse me is the data shape is exactly the same as the placeholder, both
are (10, 1), but why still raise this error? A further quesiton is when i feed
the data to the placeholder, what should the data be like(the data type and
the data shape)?

Any help will be grateful :)


Answer: You cannot use `sess.run([])`, you need to provide a graph node inside like:

    
    
    sess.run([some_node], feed_dict=feed_dict)
    

