Git Product home page Git Product logo

tf-lstm-stock-market's People

Contributors

shubhangdesai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tf-lstm-stock-market's Issues

I get this error

Traceback (most recent call last):
File "test.py", line 23, in
print(predict.predict(stock, data))
File "/workspace/lstm/src/predict.py", line 58, in predict
prediction = sess.run([yT], feed_dict={x: data})
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 778, in run
run_metadata_ptr)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 961, in _run
% (np_val.shape, subfeed_t.name, str(subfeed_t.get_shape())))
ValueError: Cannot feed value of shape (5, 30) for Tensor u'strided_slice_58:0', which has shape '(5, 29)'

I have a question

In jupyter note book, when I ran / src / model.py,
The following error occurred.

TypeError Traceback (most recent call last)
in ()
     18 valid_batch = batch.astype (np.float32)
     19
---> 20 v_l, yT = ​​sess.run ([loss, yT], feed_dict = {x: valid_batch}
     21 yT = ​​yT [:, 0]
     22 print ('Validation predictions:% s'% yT)

/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.pyc in run (self, fetches, feed_dict, options, run_metadata)
    764 try:
    765 result = self._run (None, fetches, feed_dict, options_ptr,
-> 766 run_metadata_ptr)
    767 if run_metadata:
    768 proto_data = tf_session.TF_GetBuffer (run_metadata_ptr)

/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.pyc in _run (self, handle, fetches, feed_dict, options, run_metadata)
    949
    950 # Create a fetch handler to take care of the structure of fetches.
-> 951 fetch_handler = _FetchHandler (self._graph, fetches, feed_dict_string)
    952
    953 # Run request and get response.

/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.pyc in __init __ (self, graph, fetches, feeds)
    405 "" "
    406 with graph.as_default ():
-> 407 self._fetch_mapper = _FetchMapper.for_fetch (fetches)
    408 self._fetches = []
    409 self._targets = []

/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.pyc in for_fetch (fetch)
    228 elif isinstance (fetch, (list, tuple)):
    229 # NOTE (touts): This is also the code path for namedtuples.
-> 230 return _ListFetchMapper (fetch)
    231 elif isinstance (fetch, dict):
    232 return _DictFetchMapper (fetch)

/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.pyc in __init __ (self, fetches)
    335 "" "
    336 self._fetch_type = type (fetches)
-> 337 self._mappers = [_FetchMapper.for_fetch (fetch) for fetch in fetches]
    338 self._unique_fetches, self._value_indices = _uniquify_fetches (self._mappers)
    339

/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.pyc in for_fetch (fetch)
    236 if isinstance (fetch, tensor_type):
    237 fetches, contraction_fn = fetch_fn (fetch)
-> 238 return _ElementFetchMapper (fetches, contraction_fn)
    239 # Did not find anything.
    240 raise TypeError ('Fetch argument% r has invalid type% r'

/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.pyc in __init __ (self, fetches, contraction_fn)
    269 ​​raise TypeError ('Fetch argument% r has invalid type% r,
    270 'must be a string or Tensor. (% S) '
-> 271% (fetch, type (fetch), str (e)))
    272 except ValueError as e:
    273 raise ValueError ('Fetch argument% r can not be interpreted as a'

TypeError: Fetch argument array ([0.00020096, 0.00783397, 0.0033433, 0.01605761, 0.01444326], dtype = float32) has invalid type <type 'numpy.ndarray', must be a string or Tensor. (Can not convert a ndarray into a Tensor or Operation.)

How do I resolve it?
Currently I am using python 2.7,
I'm using tensorflow 0.12.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.