Closed JianghaoPi closed 7 years ago
你好,我刚才运行stock_predict2.py 这个代码 ,报这个错诶
File "
IndexError: index 7 is out of bounds for axis 1 with size 7
@JianghaoPi 谢谢提醒。
以下是编辑错误,已在代码中修改。
import tensorflow 改成 import tensorflow as tf
rnn应该改成lstm
数据集已经换了一个
@qingaidexin 数据集的问题,已经换了一个
楼主,目前提示错误,麻烦问下stock_predict_2.py 可以直接跑吗?需要调整什么吗?还是python和tensorflow是哪个版本的啊? ValueError: Variable first_lstm/RNN/BasicLSTMCell/Linear/Matrix already exists, disallowed. Did you mean to set reuse=True in VarScope? Originally defined at:
File "stock_predict2.py", line 55, in lstm
output_rnn,final_states=tf.nn.dynamic_rnn(cell, input_rnn,initial_state=init_state, dtype=tf.float32)
File "stock_predict2.py", line 66, in trainlstm
pred,=lstm(batch_size)
File "stock_predict.py", line 86, in
@anxxxxx 你可以试试训练和测试分开进行
谢谢楼主,跑通了!
这个代码貌似跑不了啊
@anxxxxx 怎么跑通的,可否说一下?谢谢哈!
按照楼主说的,先注释掉预测,运行一次;再注释掉训练,预测一次,就OK了
axy5106@126.com
发件人: feifeiliang 发送时间: 2017-03-23 16:42 收件人: LouisScorpio/deeplearning 抄送: anxxxxx; Mention 主题: Re: [LouisScorpio/deeplearning] 你确定这代码能跑吗? (#2) @anxxxxx 怎么跑通的,可否说一下?谢谢哈! — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
@anxxxxx 是不是环境的关系啊,我的tf是0.8,python 2.7还是报下面错:
Traceback (most recent call last):
File "stock_predict_2.py", line 115, in
那个stock_predict.py,import tensorflow as tf都没有,后面使用tf怎么能成功?还有那个rnn是哪里来的? 第二个stock_predict_2.py,会发生越界。请问能跑的代码是哪个版本?