Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eval.py运行出现问题 #5

Open
qinj12 opened this issue Jul 4, 2017 · 3 comments
Open

eval.py运行出现问题 #5

qinj12 opened this issue Jul 4, 2017 · 3 comments

Comments

@qinj12
Copy link

qinj12 commented Jul 4, 2017

Parameters:
ALLOW_SOFT_PLACEMENT=True
BATCH_SIZE=64
CHECKPOINT_DIR=./runs/1498711744/checkpoints
EVAL_TRAIN=True
INPUT_LABEL_FILE=./data/testlabel.txt
INPUT_TEXT_FILE=./data/test.txt
LOG_DEVICE_PLACEMENT=False

Cannot find a valid checkpoint file!

运行出现上面的问题,是什么原因呢

@clayandgithub
Copy link
Owner

checkpoint_file = tf.train.latest_checkpoint(FLAGS.checkpoint_dir)这一行报的错,
意味着在./runs/1498711744/checkpoints没有找到合法的checkpoint文件。
请确保该文件夹存在并且有若干checkpoint文件,正常来说在运行完train之后会自动产生这些checkpoint的

@ghost
Copy link

ghost commented Jul 16, 2017

想问一下No such file or directory:'../vocab'是怎么回事呀?谢谢
Parameters:
ALLOW_SOFT_PLACEMENT=True
BATCH_SIZE=64
CHECKPOINT_DIR=
EVAL_TRAIN=True
LOG_DEVICE_PLACEMENT=False
NEGATIVE_DATA_FILE=./data/rt-polaritydata/rt-polarity.neg
POSITIVE_DATA_FILE=./data/rt-polaritydata/rt-polarity.pos

Traceback (most recent call last):
File "eval.py", line 47, in
vocab_processor = learn.preprocessing.VocabularyProcessor.restore(vocab_path)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/preprocessing/text.py", line 225, in restore
with gfile.Open(filename, 'rb') as f:
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/default/_gfile.py", line 452, in Open
return GFile(name, mode=mode)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/default/_gfile.py", line 215, in init
super(GFile, self).init(name, mode, _Pythonlocker())
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/default/_gfile.py", line 63, in init
self._fp = open(name, mode)
IOError: [Errno 2] No such file or directory: '../vocab'

其中
46行: vocab_path = os.path.join(FlAGS.checkpoint_dir, "..", "vocab")
47行: vocab_processor = learn.preprocessing.VocabularyProcessor.restore(vocab_path)
生成有vocab 并且和checkpoints还有summaries在一个目录下

@zhangyahui-0902
Copy link

Traceback (most recent call last):
File "C:/Users/host/PycharmProjects/rumor/CNN_Text/eval.py", line 112, in
correct_predictions = float(sum(all_predictions == y_test))
TypeError: 'bool' object is not iterable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants