jerryli27 / AniSeg

A faster-rcnn model for anime character segmentation.
Apache License 2.0
202 stars 15 forks source link

Not working in colab: Attempted to map inputs that were not found in graph_def: [image_tensor:0] #11

Open Aivean opened 3 years ago

Aivean commented 3 years ago

Hi,

I'm trying to run this project in colab and getting the error listed below.

Here is an example colab to reproduce the issue: https://colab.research.google.com/drive/1eo7Lz3eL8ML6BchlB84MyEOReh0YsuKI?usp=sharing

Is this a bug or am I doing something wrong? Thanks in advance.

/content/AniSeg/object_detection/inference/mask_inference.py:123: RuntimeWarning: Unexpected end-group tag: Not all data was converted
  graph_def.MergeFromString(graph_content)
Traceback (most recent call last):
  File "infer_from_image.py", line 139, in <module>
    tf.app.run()
  File "/tensorflow-1.15.2/python3.7/tensorflow_core/python/platform/app.py", line 40, in run
    _run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef)
  File "/usr/local/lib/python3.7/dist-packages/absl/app.py", line 300, in run
    _run_main(main, args)
  File "/usr/local/lib/python3.7/dist-packages/absl/app.py", line 251, in _run_main
    sys.exit(main(argv))
  File "infer_from_image.py", line 85, in main
    image_tensor, FLAGS.inference_graph, override_num_detections=FLAGS.override_num_detections)
  File "/content/AniSeg/object_detection/inference/mask_inference.py", line 126, in build_inference_graph
    graph_def, name='', input_map={'image_tensor': image_tensor})
  File "/tensorflow-1.15.2/python3.7/tensorflow_core/python/util/deprecation.py", line 507, in new_func
    return func(*args, **kwargs)
  File "/tensorflow-1.15.2/python3.7/tensorflow_core/python/framework/importer.py", line 405, in import_graph_def
    producer_op_list=producer_op_list)
  File "/tensorflow-1.15.2/python3.7/tensorflow_core/python/framework/importer.py", line 535, in _import_graph_def_internal
    ', '.join(missing_unused_input_keys))
ValueError: Attempted to map inputs that were not found in graph_def: [image_tensor:0]
cathean commented 2 years ago

I had this issue, in my situation the problem was the .pb model got corrupted. make sure to check the file size.