请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

ValueError: Unsupported Ops in the model before optimization

网上下载的 yolo 模型,转换报这个错怎么回事

执行

tensorflowjs_converter \
    --input_format=tf_saved_model \
    --output_format=tfjs_graph_model \
    --signature_name=serving_default \
    --saved_model_tags=serve \
    serving/yolov3/1 \
    serving/yolov3/web

然后报错了

2020-02-01 14:55:24.291425: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2020-02-01 14:55:24.377640: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x7fd4acfc0840 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2020-02-01 14:55:24.377668: I tensorflow/compiler/xla/service/service.cc:176]   StreamExecutor device (0): Host, Default Version
2020-02-01 14:55:27.191932: I tensorflow/core/grappler/devices.cc:60] Number of eligible GPUs (core count >= 8, compute capability >= 0.0): 0 (Note: TensorFlow was not compiled with CUDA support)
2020-02-01 14:55:27.192725: I tensorflow/core/grappler/clusters/single_machine.cc:356] Starting new session
2020-02-01 14:55:27.264027: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:814] Optimization results for grappler item: graph_to_optimize
2020-02-01 14:55:27.264054: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:816]   function_optimizer: Graph size after: 578 nodes (513), 1191 edges (1123), time = 40.338ms.
2020-02-01 14:55:27.264060: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:816]   function_optimizer: function_optimizer did nothing. time = 1.452ms.
Traceback (most recent call last):
  File "/Users/stanley/opt/anaconda3/envs/tfjs/bin/tensorflowjs_converter", line 8, in <module>
    sys.exit(pip_main())
  File "/Users/stanley/opt/anaconda3/envs/tfjs/lib/python3.6/site-packages/tensorflowjs/converters/converter.py", line 645, in pip_main
    main([' '.join(sys.argv[1:])])
  File "/Users/stanley/opt/anaconda3/envs/tfjs/lib/python3.6/site-packages/tensorflowjs/converters/converter.py", line 649, in main
    convert(argv[0].split(' '))
  File "/Users/stanley/opt/anaconda3/envs/tfjs/lib/python3.6/site-packages/tensorflowjs/converters/converter.py", line 595, in convert
    strip_debug_ops=args.strip_debug_ops)
  File "/Users/stanley/opt/anaconda3/envs/tfjs/lib/python3.6/site-packages/tensorflowjs/converters/tf_saved_model_conversion_v2.py", line 440, in convert_tf_saved_model
    strip_debug_ops=strip_debug_ops)
  File "/Users/stanley/opt/anaconda3/envs/tfjs/lib/python3.6/site-packages/tensorflowjs/converters/tf_saved_model_conversion_v2.py", line 141, in optimize_graph
    ', '.join(unsupported))
ValueError: Unsupported Ops in the model before optimization
CombinedNonMaxSuppression

正在回答 回答被采纳积分+3

2回答

提问者 st2020 2020-02-01 15:20:19

对,文件结构是这样子的 

https://img1.sycdn.imooc.com//szimg/5e3526a70961782713640516.jpg

0 回复 有任何疑惑可以回复我~
  • lewis #1
    那么输入格式应该没有问题,这个bug可能是tfjs converter的bug,去他们的github提交issue吧
    回复 有任何疑惑可以回复我~ 2020-02-01 15:22:15
lewis 2020-02-01 15:07:20

你下载的yolo模型是tf的saved model吗?

0 回复 有任何疑惑可以回复我~
  • 提问者 st2020 #1
    对,文件结构是这样子的 (上面加了截图)
    回复 有任何疑惑可以回复我~ 2020-02-01 15:20:03
  • 提问者 st2020 #2
    ???
    回复 有任何疑惑可以回复我~ 2020-02-02 20:41:37
  • lewis 回复 提问者 st2020 #3
    不是所有的模型都可以转换的,如果你真的想转从网上下载的这种模型的话,可以把错误截图贴到 tfjs converter的github的issue里,让他们兼容你这个模型,我也转换过目标检测模型,当时缺少一个relu6,就是让他们更新兼容的
    回复 有任何疑惑可以回复我~ 2020-02-02 20:44:18
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信