Skip to content
This repository was archived by the owner on Dec 11, 2023. It is now read-only.
This repository was archived by the owner on Dec 11, 2023. It is now read-only.

Explicit session gives fetch error #215

@humanely

Description

@humanely

Hi,

I have to keep persistent session for serving. So instead of creating tf.session by "with" statement, I created a under:


sess = tf.Session(
            graph=infer_model.graph, config=utils.get_config_proto())
        loaded_infer_model = model_helper.load_model(
              infer_model.model, ckpt, sess, "infer")

But this gives following error (in model_helper.load_model ): Can someone please suggest for how to load explicit session which can be reused?

File "/home/pksingh/sans/app/nmt/model_helper.py", line 444, in load_model
session.run(tf.tables_initializer())
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 889, in run
run_metadata_ptr)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1103, in _run
self._graph, fetches, feed_dict_tensor, feed_handles=feed_handles)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 414, in init
self._fetch_mapper = _FetchMapper.for_fetch(fetches)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 242, in for_fetch
return _ElementFetchMapper(fetches, contraction_fn)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 278, in init
'Tensor. (%s)' % (fetch, str(e)))
ValueError: Fetch argument <tf.Operation 'init_all_tables' type=NoOp> cannot be interpreted as a Tensor. (Operation name: "init_all_tables"
op: "NoOp"
is not an element of this graph.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions