ilovin / lstm_ctc_ocr

Use CTC + tensorflow to OCR
https://ilovin.github.io/2017-04-06/tensorflow-lstm-ctc-ocr/
354 stars 140 forks source link

Cannot run the code of the master branch #7

Closed Naruto-Sasuke closed 7 years ago

Naruto-Sasuke commented 7 years ago

I install tensorflow 1.0.1 and it errors like this:

yan@yan:~/lstm_ctc_ocr$ python ./standard/lstm_ocr.py
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcublas.so.8.0 locally
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcudnn.so.5 locally
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcufft.so.8.0 locally
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcurand.so.8.0 locally
Traceback (most recent call last):
  File "./standard/lstm_ocr.py", line 203, in <module>
    train(train_dir='../train',val_dir='../val')
  File "./standard/lstm_ocr.py", line 112, in train
    g = Graph()
  File "./standard/lstm_ocr.py", line 51, in __init__
    stack = tf.contrib.rnn.MultiRNNCell([tf.contrib.rnn.LSTMCell(FLAGS.num_hidden,state_is_tuple=True) for _ in range(FLAGS.num_layers)] , state_is_tuple=True)
  File "/home/yan/anaconda3/lib/python3.6/site-packages/tensorflow/__init__.py", line 35, in __getattr__
    contrib = importlib.import_module('tensorflow.contrib')
  File "/home/yan/anaconda3/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 978, in _gcd_import
  File "<frozen importlib._bootstrap>", line 961, in _find_and_load
  File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed
  File "/home/yan/anaconda3/lib/python3.6/site-packages/tensorflow/contrib/__init__.py", line 29, in <module>
    from tensorflow.contrib import factorization
  File "/home/yan/anaconda3/lib/python3.6/site-packages/tensorflow/contrib/factorization/__init__.py", line 24, in <module>
    from tensorflow.contrib.factorization.python.ops.gmm import *
  File "/home/yan/anaconda3/lib/python3.6/site-packages/tensorflow/contrib/factorization/python/ops/gmm.py", line 32, in <module>
    from tensorflow.contrib.learn.python.learn import graph_actions
  File "/home/yan/anaconda3/lib/python3.6/site-packages/tensorflow/contrib/learn/__init__.py", line 70, in <module>
    from tensorflow.contrib.learn.python.learn import *
yan@yan:~/Paper_code/lstm_ctc_ocr$ python ./standard/lstm_ocr.py
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcublas.so.8.0 locally
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcudnn.so.5 locally
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcufft.so.8.0 locally
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcurand.so.8.0 locally
Traceback (most recent call last):
  File "./standard/lstm_ocr.py", line 203, in <module>
    train(train_dir='../train',val_dir='../val')
  File "./standard/lstm_ocr.py", line 112, in train
    g = Graph()
  File "./standard/lstm_ocr.py", line 51, in __init__
    stack = tf.contrib.rnn.MultiRNNCell([tf.contrib.rnn.LSTMCell(FLAGS.num_hidden,state_is_tuple=True) for _ in range(FLAGS.num_layers)] , state_is_tuple=True)
  File "/home/yan/anaconda3/lib/python3.6/site-packages/tensorflow/__init__.py", line 35, in __getattr__
    contrib = importlib.import_module('tensorflow.contrib')
  File "/home/yan/anaconda3/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 978, in _gcd_import
  File "<frozen importlib._bootstrap>", line 961, in _find_and_load
  File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed
  File "/home/yan/anaconda3/lib/python3.6/site-packages/tensorflow/contrib/__init__.py", line 29, in <module>
    from tensorflow.contrib import factorization
  File "/home/yan/anaconda3/lib/python3.6/site-packages/tensorflow/contrib/factorization/__init__.py", line 24, in <module>
    from tensorflow.contrib.factorization.python.ops.gmm import *
  File "/home/yan/anaconda3/lib/python3.6/site-packages/tensorflow/contrib/factorization/python/ops/gmm.py", line 32, in <module>
    from tensorflow.contrib.learn.python.learn import graph_actions
  File "/home/yan/anaconda3/lib/python3.6/site-packages/tensorflow/contrib/learn/__init__.py", line 70, in <module>
    from tensorflow.contrib.learn.python.learn import *
  File "/home/yan/anaconda3/lib/python3.6/site-packages/tensorflow/contrib/learn/python/__init__.py", line 23, in <module>
    from tensorflow.contrib.learn.python.learn import *
  File "/home/yan/anaconda3/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/__init__.py", line 25, in <module>
    from tensorflow.contrib.learn.python.learn import estimators
  File "/home/yan/anaconda3/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/estimators/__init__.py", line 310, in <module>
    from tensorflow.contrib.learn.python.learn.estimators.dnn import DNNClassifier
  File "/home/yan/anaconda3/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/estimators/dnn.py", line 29, in <module>
    from tensorflow.contrib.learn.python.learn.estimators import dnn_linear_combined
  File "/home/yan/anaconda3/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/estimators/dnn_linear_combined.py", line 33, in <module>
    from tensorflow.contrib.learn.python.learn.estimators import estimator
  File "/home/yan/anaconda3/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py", line 51, in <module>
    from tensorflow.contrib.learn.python.learn.learn_io import data_feeder
  File "/home/yan/anaconda3/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/learn_io/__init__.py", line 21, in <module>
    from tensorflow.contrib.learn.python.learn.learn_io.dask_io import extract_dask_data
  File "/home/yan/anaconda3/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/learn_io/dask_io.py", line 26, in <module>
    import dask.dataframe as dd
  File "/home/yan/anaconda3/lib/python3.6/site-packages/dask/dataframe/__init__.py", line 3, in <module>
    from .core import (DataFrame, Series, Index, _Frame, map_partitions,
  File "/home/yan/anaconda3/lib/python3.6/site-packages/dask/dataframe/core.py", line 38, in <module>
    pd.computation.expressions.set_use_numexpr(False)
AttributeError: module 'pandas' has no attribute 'computation'

Any help will be appreciated.