cnn-text-classification-tf icon indicating copy to clipboard operation
cnn-text-classification-tf copied to clipboard

I run train.py and then run eval.py, have error,could you help me please!

Open WestbrookZero opened this issue 7 years ago • 6 comments

Traceback (most recent call last): File "D:/Projects/PythonProject/TensorFlow/cnn-text-classification-tf-master01/eval.py", line 71, in vocab_processor = learn.preprocessing.VocabularyProcessor.restore(vocab_path) File "D:\Python3.5.2\lib\site-packages\tensorflow\contrib\learn\python\learn\preprocessing\text.py", line 226, in restore return pickle.loads(f.read()) File "D:\Python3.5.2\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 106, in read self._preread_check() File "D:\Python3.5.2\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 73, in _preread_check compat.as_bytes(self.__name), 1024 * 512, status) File "D:\Python3.5.2\lib\contextlib.py", line 66, in exit next(self.gen) File "D:\Python3.5.2\lib\site-packages\tensorflow\python\framework\errors_impl.py", line 469, in raise_exception_on_not_ok_status pywrap_tensorflow.TF_GetCode(status)) tensorflow.python.framework.errors_impl.NotFoundError: NewRandomAccessFile failed to Create/Open: ..\vocab : ϵͳ\udcd5Ҳ\udcbb\udcb5\udcbdָ\udcb6\udca8\udcb5\udcc4\udcceļ\udcfe\udca1\udca3

WestbrookZero avatar Apr 11 '17 06:04 WestbrookZero

I met the same problem too.

lilytly123 avatar May 01 '17 09:05 lilytly123

When you run eval.py, make sure there is no white-space in python eval.py --eval_train --checkpoint_dir=./runs/1459637919/checkpoints/ or ./eval.py --eval_train --checkpoint_dir="./runs/1459637919/checkpoints/" (Do not put white-spaces around the '=' sign. )

Then, check the first lines of output, and see if line starting with "CHECKPOINT_DIR" refers to your checkpoints directory.

sighsmile avatar May 12 '17 07:05 sighsmile

did u try to run train.py and eval.py at the same time ? plz consider memory issue

Abduoit avatar Aug 23 '17 12:08 Abduoit

i had to remap the model, checkpoints, and vocab file in the eval step. works now.

python2 eval.py --eval_train --checkpoint_dir="./runs/1507082809/checkpoints/" --model="./runs/1507082809/checkpoints/model-1000" --vocab_filepath="./runs/1507082809/checkpoints/vocab"

robohal avatar Oct 05 '17 20:10 robohal

i met the same problem too. i use python3.5 and tensorflow1.2.1 in win7. i think it's not the command line problem as @sighsmile said. And i don't konw what to do to deal whit it now.

i replaced the tensorflow.contrib.learn.preprocessing.VocabularyProcessor.restore(vocab_path) with pickle and it works, but i still don't konw why restore(vocab_path) didn't work

goyidao avatar Jan 31 '18 09:01 goyidao

can any one please explain how to do what goyidao did in windows ie how to replace the tensorflow.contrib.learn.preprocessing.VocabularyProcessor.restore(vocab_path) with pickle

shashanka300 avatar Apr 21 '18 05:04 shashanka300