lilianweng / stock-rnn

Predict stock market prices using RNN model with multilayer LSTM cells + optional multi-stock embeddings.
https://lilianweng.github.io/lil-log
1.72k stars 656 forks source link

Error Running data_fetcher.py #22

Open VK9999 opened 5 years ago

VK9999 commented 5 years ago

When i run the code i am getting the following error. I did got lot of module errors and i have changed the urllib2 to urlib2.requests and beautifulSoap to bs4. Can you please check this issue and let me know.

I did add the future library to resolve the below issue but it failed.


UserWarning: Converting sparse IndexedSlices to a dense Tensor of unknown shape. This may consume a large amount of memory. "Converting sparse IndexedSlices to a dense Tensor of unknown shape. "

Variables: name (type shape) [size]

dynamic_rnn/lstm_cell/kernel:0 (float32_ref 129x512) [66048, bytes: 264192] dynamic_rnn/lstm_cell/bias:0 (float32_ref 512) [512, bytes: 2048] w:0 (float32_ref 128x1) [128, bytes: 512] b:0 (float32_ref 1) [1, bytes: 4] Total size of variables: 66689 Total bytes of variables: 266756 len(merged_test_X) = 0 len(merged_test_y) = 0 len(merged_test_labels) = 0 {'SP500': array([], dtype=float64)} Start training for stocks: ['SP500'] Traceback (most recent call last): File "main.py", line 111, in tf.app.run() File "C:\Users\abc\PycharmProjects\Stocks-RNN\tensorflow\python\platform\app.py", line 125, in run _sys.exit(main(argv)) File "main.py", line 104, in main rnn_model.train(stock_data_list, FLAGS) File "C:\Users\abc\PycharmProjects\Stocks-RNN\model_rnn.py", line 212, in train for epoch in xrange(config.max_epoch): NameError: name 'xrange' is not defined

VK9999 commented 5 years ago

I resolved the above issue by adding "from past.builtins import xrange". Now i am getting the following error .

raise HTTPError(req.full_url, code, msg, hdrs, fp) urllib.error.HTTPError: HTTP Error 404: Not Found

VK9999 commented 5 years ago

Resolved the above issue by changing the path of the S&P 500 file location. https://raw.githubusercontent.com/datasets/s-and-p-companies-financials/master/data/constituents-financials.csv