Question: I have a script in javascript that load more information on page scroll down.
The problem is that when I scroll down the script is executed twice and I have the same result twice or even more.

I want to execute the script once each time I scroll down and not execute it twice or even more each time.

This is the script:

```js
$(window).scroll(function(){

        var lastID = $('.load-more').attr('lastid');
        if ($(window).scrollTop() == $(document).height() - $(window).height() && lastID != 0){
            $.ajax({
                type:'POST',
                url:'getdata.php',
                data:'id='+lastID,
                beforeSend:function(html){
                    $('.load-more').show();
                },
                success:function(html){
                    $('.load-more').remove();
                    $('#list').append(html);
                }
            });
        }
    });

```

Answer: 
The second argument to `get_variable` takes an integer or string, but as the error say, you've given it a tensor `[dim, 384]`.

See: <https://www.tensorflow.org/api_docs/python/tf/get_variable>
`tf.shape` returns a tensor, so *dim* in `[dim, 384]` is a Tensor; here is an int needed.

Try `dim = reshape.get_shape().as_list()[1]` # output is of int type