Estimator predict 错误
发布于 6天前 作者 eshaoliu 来自问答

欢迎来到AI论坛

想用estimator predict load checkpoint,但是有如下错误,train和evaluate都没问题,求大神指教。

File "/Users/liuhongru3/opt/anaconda3/lib/python3.7/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 1112, in _call_model_fn

    model_fn_results = self._model_fn(features=features, **kwargs)

  File "run.py", line 359, in model_fn

    tvars, init_checkpoint)

  File "/Users/liuhongru3/code/BERT4Rec/modeling.py", line 323, in get_assignment_map_from_checkpoint

    init_vars = tf.train.list_variables(init_checkpoint)

  File "/Users/liuhongru3/opt/anaconda3/lib/python3.7/site-packages/tensorflow/python/training/checkpoint_utils.py", line 95, in list_variables

    reader = load_checkpoint(ckpt_dir_or_file)

  File "/Users/liuhongru3/opt/anaconda3/lib/python3.7/site-packages/tensorflow/python/training/checkpoint_utils.py", line 60, in load_checkpoint

    filename = _get_checkpoint_filename(ckpt_dir_or_file)

  File "/Users/liuhongru3/opt/anaconda3/lib/python3.7/site-packages/tensorflow/python/training/checkpoint_utils.py", line 283, in _get_checkpoint_filename

    if gfile.IsDirectory(ckpt_dir_or_file):

  File "/Users/liuhongru3/opt/anaconda3/lib/python3.7/site-packages/tensorflow/python/lib/io/file_io.py", line 590, in is_directory

    return is_directory_v2(dirname)

  File "/Users/liuhongru3/opt/anaconda3/lib/python3.7/site-packages/tensorflow/python/lib/io/file_io.py", line 604, in is_directory_v2

    return pywrap_tensorflow.IsDirectory(compat.as_bytes(path), status)

  File "/Users/liuhongru3/opt/anaconda3/lib/python3.7/site-packages/tensorflow/python/util/compat.py", line 61, in as_bytes

    (bytes_or_text,))

TypeError: Expected binary or unicode string, got None

回到顶部