无法使用op为MaxBytesInUse导入元图

时间:2018-04-10 23:00:00

标签: tensorflow

当我尝试使用saver = tf.train.import_meta_graph(meta_graph_path, clear_devices=True)导入元图时,我从导入器中获取KeyError:'MaxBytesInUse'。

Tensorflow版本:1.7-gpu-python3 操作系统:Ubuntu 16.04

以下是错误的堆栈跟踪:

/usr/local/lib/python3.5/dist-packages/tensorflow/python/training/saver.py in import_meta_graph(meta_graph_or_file, clear_devices, import_scope, **kwargs)
       1953       clear_devices=clear_devices,
       1954       import_scope=import_scope,
    -> 1955       **kwargs)
       1956 
       1957   if meta_graph_def.HasField("saver_def"):

    /usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/meta_graph.py in import_scoped_meta_graph(meta_graph_or_file, clear_devices, graph, import_scope, input_map, unbound_inputs_col_name, restore_collections_predicate)
        741         name=(import_scope or scope_to_prepend_to_names),
        742         input_map=input_map,
    --> 743         producer_op_list=producer_op_list)
        744 
        745     # Restores all the other collections.

    /usr/local/lib/python3.5/dist-packages/tensorflow/python/util/deprecation.py in new_func(*args, **kwargs)
        430                 'in a future version' if date is None else ('after %s' % date),
        431                 instructions)
    --> 432       return func(*args, **kwargs)
        433     return tf_decorator.make_decorator(func, new_func, 'deprecated',
        434                                        _add_deprecated_arg_notice_to_docstring(

    /usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/importer.py in import_graph_def(graph_def, input_map, return_elements, name, op_dict, producer_op_list)
        458   if producer_op_list is not None:
        459     # TODO(skyewm): make a copy of graph_def so we're not mutating the argument?
    --> 460     _RemoveDefaultAttrs(op_dict, producer_op_list, graph_def)
        461 
        462   graph = ops.get_default_graph()

    /usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/importer.py in _RemoveDefaultAttrs(op_dict, producer_op_list, graph_def)
        225     # Remove any default attr values that aren't in op_def.
        226     if node.op in producer_op_dict:
    --> 227       op_def = op_dict[node.op]
        228       producer_op_def = producer_op_dict[node.op]
        229       # We make a copy of node.attr to iterate through since we may modify

    KeyError: 'MaxBytesInUse'

0 个答案:

没有答案