TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10 icon indicating copy to clipboard operation
TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10 copied to clipboard

Load a (frozen) Tensorflow model into memory.

Open Icyfire18 opened this issue 6 years ago • 3 comments
trafficstars

ERROR IS AS FOLLOWS: AttributeError Traceback (most recent call last) in 1 detection_graph = tf.Graph() 2 with detection_graph.as_default(): ----> 3 od_graph_def = tf.GraphDef() 4 with tf.gfile.GFile(PATH_TO_FROZEN_GRAPH, 'rb') as fid: 5 serialized_graph = fid.read()

AttributeError: module 'tensorflow' has no attribute 'GraphDef'

Icyfire18 avatar Oct 02 '19 09:10 Icyfire18

Same here, I believe it is an issue with setting the path variable/your environmental variables.

ericenouen avatar Oct 07 '19 01:10 ericenouen

I think you should try not downloading the latest TensorFlow model and instead doing: pip install tensorflow==1.5

ericenouen avatar Oct 07 '19 03:10 ericenouen

detection_graph = tf.Graph() with detection_graph.as_default(): od_graph_def = tf.GraphDef() with tf.gfile.GFile(PATH_TO_FROZEN_GRAPH, 'rb') as fid: serialized_graph = fid.read() od_graph_def.ParseFromString(serialized_graph) tf.import_graph_def(od_graph_def, name='')

while executing above command i am getting following error......... any help error:

InvalidArgumentError Traceback (most recent call last) c:\users\saiki\anaconda3\envs\fdet\lib\site-packages\tensorflow\python\framework\importer.py in import_graph_def(graph_def, input_map, return_elements, name, op_dict, producer_op_list) 426 results = c_api.TF_GraphImportGraphDefWithResults( --> 427 graph._c_graph, serialized, options) # pylint: disable=protected-access 428 results = c_api_util.ScopedTFImportGraphDefResults(results)

InvalidArgumentError: NodeDef mentions attr 'incompatible_shape_error' not in Op<name=Equal; signature=x:T, y:T -> z:bool; attr=T:type,allowed=[DT_BFLOAT16, DT_HALF, DT_FLOAT, DT_DOUBLE, DT_UINT8, ..., DT_QINT8, DT_QINT32, DT_STRING, DT_BOOL, DT_COMPLEX128]; is_commutative=true>; NodeDef: {{node GridAnchorGenerator/assert_equal_1/Equal}}. (Check whether your GraphDef-interpreting binary is up to date with your GraphDef-generating binary.).

During handling of the above exception, another exception occurred:

ValueError Traceback (most recent call last) in 5 serialized_graph = fid.read() 6 od_graph_def.ParseFromString(serialized_graph) ----> 7 tf.import_graph_def(od_graph_def, name='')

c:\users\saiki\anaconda3\envs\fdet\lib\site-packages\tensorflow\python\util\deprecation.py in new_func(*args, **kwargs) 505 'in a future version' if date is None else ('after %s' % date), 506 instructions) --> 507 return func(*args, **kwargs) 508 509 doc = _add_deprecated_arg_notice_to_docstring(

c:\users\saiki\anaconda3\envs\fdet\lib\site-packages\tensorflow\python\framework\importer.py in import_graph_def(graph_def, input_map, return_elements, name, op_dict, producer_op_list) 429 except errors.InvalidArgumentError as e: 430 # Convert to ValueError for backwards compatibility. --> 431 raise ValueError(str(e)) 432 433 # Create _DefinedFunctions for any imported functions.

ValueError: NodeDef mentions attr 'incompatible_shape_error' not in Op<name=Equal; signature=x:T, y:T -> z:bool; attr=T:type,allowed=[DT_BFLOAT16, DT_HALF, DT_FLOAT, DT_DOUBLE, DT_UINT8, ..., DT_QINT8, DT_QINT32, DT_STRING, DT_BOOL, DT_COMPLEX128]; is_commutative=true>; NodeDef: {{node GridAnchorGenerator/assert_equal_1/Equal}}. (Check whether your GraphDef-interpreting binary is up to date with your GraphDef-generating binary.).

mycuriosity123 avatar Jan 30 '21 17:01 mycuriosity123