tensorflow / tfjs

A WebGL accelerated JavaScript library for training and deploying ML models.
https://js.tensorflow.org
Apache License 2.0
18.51k stars 1.94k forks source link

tfjs-converter fail to convert fronzen_model #4731

Closed SukkaW closed 3 years ago

SukkaW commented 3 years ago

Please make sure that this is a build/installation issue. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:build_template

System information

$ pip3 list | grep tensorflow

tensorflow             2.4.1
tensorflow-estimator   2.4.0
tensorflow-hub         0.9.0
tensorflowjs           3.1.0

Describe the problem

RT.

Provide the exact sequence of commands / steps that you executed before running into the problem

tensorflowjs_converter --input_format=tf_frozen_model --output_node_names='MobilenetV1/Predictions/Reshape_1' ./saved_model10000.pb ./web_model/

Any other info / logs

Traceback (most recent call last):
  File "/home/sukka/.pyenv/versions/3.6.8/bin/tensorflowjs_converter", line 8, in <module>
    sys.exit(pip_main())
  File "/home/sukka/.pyenv/versions/3.6.8/lib/python3.6/site-packages/tensorflowjs/converters/converter.py", line 813, in pip_main
    main([' '.join(sys.argv[1:])])
  File "/home/sukka/.pyenv/versions/3.6.8/lib/python3.6/site-packages/tensorflowjs/converters/converter.py", line 817, in main
    convert(argv[0].split(' '))
  File "/home/sukka/.pyenv/versions/3.6.8/lib/python3.6/site-packages/tensorflowjs/converters/converter.py", line 804, in convert
    weight_shard_size_bytes, metadata_map)
  File "/home/sukka/.pyenv/versions/3.6.8/lib/python3.6/site-packages/tensorflowjs/converters/converter.py", line 581, in _dispatch_converter
    metadata=metadata_map)
  File "/home/sukka/.pyenv/versions/3.6.8/lib/python3.6/site-packages/tensorflowjs/converters/tf_saved_model_conversion_v2.py", line 490, in convert_tf_frozen_model
    graph = load_graph(frozen_model_path)
  File "/home/sukka/.pyenv/versions/3.6.8/lib/python3.6/site-packages/tensorflowjs/converters/tf_saved_model_conversion_v2.py", line 63, in load_graph
    graph_def.ParseFromString(f.read())
google.protobuf.message.DecodeError: Error parsing message
rthadur commented 3 years ago

does this error occur while loading model ? if yes , can you please share reproduction code ?

SukkaW commented 3 years ago

does this error occur while loading model ? if yes , can you please share reproduction code ?

No. I am using tfjs converter cli thus I don't know if the cli was loading model. Also since I am using cli, I don't have any reproduction code. @rthadur

rthadur commented 3 years ago

It is hard for us to reproduce with out sample code or steps which you are following . Note : Frozen models conversion may not work well with latest version.

google-ml-butler[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you.

google-ml-butler[bot] commented 3 years ago

Closing as stale. Please @mention us if this needs more attention.

google-ml-butler[bot] commented 3 years ago

Are you satisfied with the resolution of your issue? Yes No