tensorflow / skflow

Simplified interface for TensorFlow (mimicking Scikit Learn) for Deep Learning
Apache License 2.0
3.18k stars 439 forks source link

TensorFlowEstimator.restore Error: tensorflow.python.pywrap_tensorflow.StatusNotOK #41

Closed harsimranb closed 8 years ago

harsimranb commented 8 years ago

Restore is still not working for the text_classification.py example. I am getting the following exception:

I tensorflow/core/common_runtime/local_device.cc:40] Local device intra op parallelism threads: 4
I tensorflow/core/common_runtime/direct_session.cc:58] Direct session inter op parallelism threads: 4
Traceback (most recent call last):
  File "/Users/harsimranb/PycharmProjects/TensorFlowTest/TextRNN.py", line 103, in <module>
    runner.run_classification("amigo what time you close?")
  File "/Users/harsimranb/PycharmProjects/TensorFlowTest/TextRNN.py", line 56, in run_classification
    classifier = skflow.TensorFlowEstimator.restore(self.trained_model_path)
  File "/Users/harsimranb/Library/Python/2.7/lib/python/site-packages/skflow/__init__.py", line 332, in restore
    estimator._restore(path)
  File "/Users/harsimranb/Library/Python/2.7/lib/python/site-packages/skflow/__init__.py", line 314, in _restore
    self._saver.restore(self._session, checkpoint_path)
  File "/Users/harsimranb/Library/Python/2.7/lib/python/site-packages/tensorflow/python/training/saver.py", line 891, in restore
    sess.run([self._restore_op_name], {self._filename_tensor_name: save_path})
  File "/Users/harsimranb/Library/Python/2.7/lib/python/site-packages/tensorflow/python/client/session.py", line 368, in run
    results = self._do_run(target_list, unique_fetch_targets, feed_dict_string)
  File "/Users/harsimranb/Library/Python/2.7/lib/python/site-packages/tensorflow/python/client/session.py", line 446, in _do_run
    six.reraise(e_type, e_value, e_traceback)
  File "/Users/harsimranb/Library/Python/2.7/lib/python/site-packages/tensorflow/python/client/session.py", line 428, in _do_run
    target_list)
tensorflow.python.pywrap_tensorflow.StatusNotOK: Internal: Unable to get element from the feed.

Related to #40

ilblackdragon commented 8 years ago

Hm, it works in the case of just text_classification.py - I created an example in text_classification_save_restore.py.

Are you doing anything custom in the model that is different?

ilblackdragon commented 8 years ago

I think it's the same issue as #43 - you were using relative path and TF doesn't work currently very well with that. I made a workaround by upping to absolute path when you call save/restore. Please try again and let me know if it doesn't work!

harsimranb commented 8 years ago

That was it, thanks!