class_docstr: Create a predictor that takes inputs from an :class:`InputSource`, instead of from feeds.
  An instance `pred` of :class:`FeedfreePredictor` can be called only by `pred()`, which returns
  a list of output values as defined in config.output_names.
class_docstr_tok: ["Create","a","predictor","that","takes","inputs","from","an",":","class",":","`","InputSource","`",",","instead","of","from","feeds",".","An","instance","`","pred","`","of",":","class",":","`","FeedfreePredictor","`","can","be","called","only","by","`","pred","(",")","`",",","which","returns","a","list","of","output","values","as","defined","in","config.output_names","."]
docstr: Args:
      config (PredictConfig): the config to use.
      input_source (InputSource): the feedfree InputSource to use.
          Must match the signature of the tower function in config.
docstr_tok: ["Args",":","config","(","PredictConfig",")",":","the","config","to","use",".","input_source","(","InputSource",")",":","the","feedfree","InputSource","to","use",".","Must","match","the","signature","of","the","tower","function","in","config","."]
code: def __init__(self, config, input_source):
      """
      Args:
          config (PredictConfig): the config to use.
          input_source (InputSource): the feedfree InputSource to use.
              Must match the signature of the tower function in config.
      """
      self._config = config
      self._input_source = input_source
      assert config.return_input is False, (
          "return_input is not supported in FeedfreePredictor! "
          "If you need to fetch inputs, add the names to the output_names!"
      )
  
      self._hooks = []
      self.graph = config._maybe_create_graph()
      with self.graph.as_default():
          self._input_callbacks = Callbacks(
              self._input_source.setup(config.input_signature)
          )
          with PredictTowerContext(""):
              self._input_tensors = (
                  self._input_source.get_input_tensors()
              )
              config.tower_func(*self._input_tensors)
              self._tower_handle = config.tower_func.towers[-1]
  
          self._output_tensors = self._tower_handle.get_tensors(
              config.output_names
          )
  
          self._input_callbacks.setup_graph(None)
  
          for h in self._input_callbacks.get_hooks():
              self._register_hook(h)
          self._initialize_session()
  
file_path: tensorpack/tensorpack/predict/feedfree.py
imports: from tensorflow.python.training.monitored_session import _HookedSession
  from ..callbacks import Callbacks
  from ..tfutils.tower import PredictTowerContext
  from .base import PredictorBase
label_desc: Use image node_id 1 to create a new FeedfreePredictor object from inherited base classes: PredictorBase with example: obj = FeedfreePredictor(config, input_source)