Conchylicultor / DeepQA

My tensorflow implementation of "A neural conversational model", a Deep learning based chatbot
Apache License 2.0
2.93k stars 1.17k forks source link

pre-trained model issue #165

Open qihongl opened 7 years ago

qihongl commented 7 years ago

Hi, I got the following error message when I was trying to run the pre-trained model. Is this a tensorflow version issue?

(brainiak) Qihong@:deepQA$ python main.py --modelTag pretrainedv2 --test interactive
/Users/Qihong/anaconda/envs/brainiak/lib/python3.6/importlib/_bootstrap.py:205: RuntimeWarning: compiletime version 3.5 of module 'tensorflow.python.framework.fast_tensor_util' does not match runtime version 3.6
  return f(*args, **kwds)
Welcome to DeepQA v0.1 !

TensorFlow detected: v1.4.0

Warning: Restoring parameters:
globStep: 32000
watsonMode: False
autoEncode: False
corpus: cornell
datasetTag: old
maxLength: 10
filterVocab: 0
skipLines: False
vocabularySize: 0
hiddenSize: 512
numLayers: 2
softmaxSamples: 0
initEmbeddings: False
embeddingSize: 64
embeddingSource: None

Loading dataset from /Users/Qihong/Dropbox/github/deepQA/data/samples/dataset-cornell-old-length10-filter0-vocabSize0.pkl
Loaded cornell: 34991 words, 139979 QA
Model creation...
2017-11-30 14:56:22.087342: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA
Initialize variables...
WARNING: Restoring previous model from /Users/Qihong/Dropbox/github/deepQA/save/model-pretrainedv2/model.ckpt
Traceback (most recent call last):
  File "/Users/Qihong/anaconda/envs/brainiak/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1323, in _do_call
    return fn(*args)
  File "/Users/Qihong/anaconda/envs/brainiak/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1302, in _run_fn
    status, run_metadata)
  File "/Users/Qihong/anaconda/envs/brainiak/lib/python3.6/site-packages/tensorflow/python/framework/errors_impl.py", line 473, in __exit__
    c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.NotFoundError: Tensor name "embedding_rnn_seq2seq/embedding_rnn_decoder/rnn_decoder/output_projection_wrapper/multi_rnn_cell/cell_0/basic_lstm_cell/bias" not found in checkpoint files /Users/Qihong/Dropbox/github/deepQA/save/model-pretrainedv2/model.ckpt
     [[Node: save/RestoreV2_3 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save/Const_0_0, save/RestoreV2_3/tensor_names, save/RestoreV2_3/shape_and_slices)]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "main.py", line 29, in <module>
    chatbot.main()
  File "/Users/Qihong/Dropbox/github/deepQA/chatbot/chatbot.py", line 196, in main
    self.managePreviousModel(self.sess)
  File "/Users/Qihong/Dropbox/github/deepQA/chatbot/chatbot.py", line 479, in managePreviousModel
    self.saver.restore(sess, modelName)  # Will crash when --reset is not activated and the model has not been saved yet
  File "/Users/Qihong/anaconda/envs/brainiak/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1666, in restore
    {self.saver_def.filename_tensor_name: save_path})
  File "/Users/Qihong/anaconda/envs/brainiak/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 889, in run
    run_metadata_ptr)
  File "/Users/Qihong/anaconda/envs/brainiak/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1120, in _run
    feed_dict_tensor, options, run_metadata)
  File "/Users/Qihong/anaconda/envs/brainiak/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1317, in _do_run
    options, run_metadata)
  File "/Users/Qihong/anaconda/envs/brainiak/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1336, in _do_call
    raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.NotFoundError: Tensor name "embedding_rnn_seq2seq/embedding_rnn_decoder/rnn_decoder/output_projection_wrapper/multi_rnn_cell/cell_0/basic_lstm_cell/bias" not found in checkpoint files /Users/Qihong/Dropbox/github/deepQA/save/model-pretrainedv2/model.ckpt
     [[Node: save/RestoreV2_3 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save/Const_0_0, save/RestoreV2_3/tensor_names, save/RestoreV2_3/shape_and_slices)]]

Caused by op 'save/RestoreV2_3', defined at:
  File "main.py", line 29, in <module>
    chatbot.main()
  File "/Users/Qihong/Dropbox/github/deepQA/chatbot/chatbot.py", line 174, in main
    self.saver = tf.train.Saver(max_to_keep=200)
  File "/Users/Qihong/anaconda/envs/brainiak/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1218, in __init__
    self.build()
  File "/Users/Qihong/anaconda/envs/brainiak/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1227, in build
    self._build(self._filename, build_save=True, build_restore=True)
  File "/Users/Qihong/anaconda/envs/brainiak/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1263, in _build
    build_save=build_save, build_restore=build_restore)
  File "/Users/Qihong/anaconda/envs/brainiak/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 751, in _build_internal
    restore_sequentially, reshape)
  File "/Users/Qihong/anaconda/envs/brainiak/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 427, in _AddRestoreOps
    tensors = self.restore_op(filename_tensor, saveable, preferred_shard)
  File "/Users/Qihong/anaconda/envs/brainiak/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 267, in restore_op
    [spec.tensor.dtype])[0])
  File "/Users/Qihong/anaconda/envs/brainiak/lib/python3.6/site-packages/tensorflow/python/ops/gen_io_ops.py", line 1021, in restore_v2
    shape_and_slices=shape_and_slices, dtypes=dtypes, name=name)
  File "/Users/Qihong/anaconda/envs/brainiak/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
    op_def=op_def)
  File "/Users/Qihong/anaconda/envs/brainiak/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 2956, in create_op
    op_def=op_def)
  File "/Users/Qihong/anaconda/envs/brainiak/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1470, in __init__
    self._traceback = self._graph._extract_stack()  # pylint: disable=protected-access

NotFoundError (see above for traceback): Tensor name "embedding_rnn_seq2seq/embedding_rnn_decoder/rnn_decoder/output_projection_wrapper/multi_rnn_cell/cell_0/basic_lstm_cell/bias" not found in checkpoint files /Users/Qihong/Dropbox/github/deepQA/save/model-pretrainedv2/model.ckpt
     [[Node: save/RestoreV2_3 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save/Const_0_0, save/RestoreV2_3/tensor_names, save/RestoreV2_3/shape_and_slices)]]
dyerrington commented 6 years ago

I also get the same error.

piratos commented 6 years ago

You are using a newer version of TensorFlow which unfortunately is not backward compatible, I solved the error by installing tensorflow-1.0.1 instead.

RajPratim21 commented 6 years ago

I am getting same error on tensorflow-1.0.1

MrCRR commented 6 years ago

My tensorflow version is 1.5.0 and get the same error

leicao-me commented 6 years ago

This happens to me too. No solution yet.

rongfeng-china commented 6 years ago

tensorflow version 1.11.0, the same error...

The solution is install tensorflow 1.0.0, and it is working now!!

pip install tensorflow==1.0.0

snorlaxse commented 5 years ago

tensorflow version 1.11.0, the same error...

The solution is install tensorflow 1.0.0, and it is working now!!

pip install tensorflow==1.0.0

I am getting same error on tensorflow-1.0.0