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

预测时报错,求解 #63

Open
Gemini77 opened this issue Nov 12, 2018 · 0 comments
Open

预测时报错,求解 #63

Gemini77 opened this issue Nov 12, 2018 · 0 comments

Comments

@Gemini77
Copy link

runfile('D:/crf058/BNN+CRF/rnn.py', wdir='D:/crf058/BNN+CRF')
building word index...
source vocabulary file has already existed, continue to next stage.
target vocabulary file has already existed, continue to next stage.
Reloaded modules: utils, config
building word index...
source vocabulary file has already existed, continue to next stage.
target vocabulary file has already existed, continue to next stage.
loading word embedding, it will take few minutes...
Traceback (most recent call last):

File "", line 1, in
runfile('D:/crf058/BNN+CRF/rnn.py', wdir='D:/crf058/BNN+CRF')

File "D:\Python\lib\site-packages\spyder\utils\site\sitecustomize.py", line 705, in runfile
execfile(filename, namespace)

File "D:\Python\lib\site-packages\spyder\utils\site\sitecustomize.py", line 102, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)

File "D:/crf058/BNN+CRF/rnn.py", line 160, in
iterator = get_predict_iterator(src_vocab_table, vocab_size, BATCH_SIZE)

File "D:\crf058\BNN+CRF\utils.py", line 230, in get_predict_iterator
batched_iter = batched_dataset.make_initializable_iterator()

File "D:\Python\lib\site-packages\tensorflow\python\data\ops\dataset_ops.py", line 118, in make_initializable_iterator
initializer = gen_dataset_ops.make_iterator(self._as_variant_tensor(),

File "D:\Python\lib\site-packages\tensorflow\python\data\ops\dataset_ops.py", line 2135, in _as_variant_tensor
self._input_dataset._as_variant_tensor(), # pylint: disable=protected-access

File "D:\Python\lib\site-packages\tensorflow\python\data\ops\dataset_ops.py", line 2205, in _as_variant_tensor
input_t = self._input_dataset._as_variant_tensor() # pylint: disable=protected-access

File "D:\Python\lib\site-packages\tensorflow\python\data\ops\dataset_ops.py", line 2210, in _as_variant_tensor
**flat_structure(self))

File "D:\Python\lib\site-packages\tensorflow\python\ops\gen_dataset_ops.py", line 2759, in map_dataset
output_shapes=output_shapes, name=name)

File "D:\Python\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 350, in _apply_op_helper
g = ops._get_graph_from_inputs(_Flatten(keywords.values()))

File "D:\Python\lib\site-packages\tensorflow\python\framework\ops.py", line 5428, in _get_graph_from_inputs
_assert_same_graph(original_graph_element, graph_element)

File "D:\Python\lib\site-packages\tensorflow\python\framework\ops.py", line 5364, in _assert_same_graph
original_item))

ValueError: Tensor("string_to_index_8/hash_table:0", shape=(), dtype=resource) must be from the same graph as Tensor("MapDataset_1:0", shape=(), dtype=variant).

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

1 participant