首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >ValueError:您传入了一个可迭代属性,但我无法确定它的适用类型。

ValueError:您传入了一个可迭代属性,但我无法确定它的适用类型。
EN

Stack Overflow用户
提问于 2019-10-20 05:16:23
回答 1查看 846关注 0票数 1

我正在尝试使用tf2onnx工具将facenet模型(20170512-110547.pb)转换为onnx格式。但是当我试图使用以下命令转换它时

代码语言:javascript
运行
复制
python3 -m tf2onnx.convert\
    --input 20170512-110547.pb\
    --inputs input:0,phase_train:0\
    --outputs embeddings:0\
    --output model.onnx\
    --verbose

它给了我这个错误

ValueError: ValueError:您传递了一个可迭代属性,但我无法确定它的适用类型。

全错误日志

代码语言:javascript
运行
复制
2019-10-20 12:12:56,655 - WARNING - tf2onnx.shape_inference: Cannot infer shape for image_batch: image_batch:0
2019-10-20 12:12:56,655 - WARNING - tf2onnx.shape_inference: Cannot infer shape for batch_join: batch_join:0,batch_join:1
2019-10-20 12:12:56,655 - WARNING - tf2onnx.shape_inference: Cannot infer shape for input: input:0
2019-10-20 12:12:56,844 - ERROR - tf2onnx.tfonnx: pass1 convert failed for name: "batch_join/fifo_queue"
op: "FIFOQueueV2"
attr {
  key: "capacity"
  value {
    i: 1440
  }
}
attr {
  key: "component_types"
  value {
    list {
      type: DT_FLOAT
      type: DT_INT64
    }
  }
}
attr {
  key: "container"
  value {
    s: ""
  }
}
attr {
  key: "shapes"
  value {
    list {
      shape {
        dim {
          size: 160
        }
        dim {
          size: 160
        }
        dim {
          size: 3
        }
      }
      shape {
      }
    }
  }
}
attr {
  key: "shared_name"
  value {
    s: ""
  }
}
, ex=You passed in an iterable attribute but I cannot figure out its applicable type.
Traceback (most recent call last):
  File "/usr/lib/python3.5/runpy.py", line 184, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/sneha/Downloads/tensorflow-onnx-master/tf2onnx/convert.py", line 161, in <module>
    main()
  File "/home/sneha/Downloads/tensorflow-onnx-master/tf2onnx/convert.py", line 145, in main
    inputs_as_nchw=args.inputs_as_nchw)
  File "/home/sneha/Downloads/tensorflow-onnx-master/tf2onnx/tfonnx.py", line 493, in process_tf_graph
    onnx_nodes, op_cnt, attr_cnt, output_shapes, dtypes = tensorflow_to_onnx(tf_graph, shape_override)
  File "/home/sneha/Downloads/tensorflow-onnx-master/tf2onnx/tfonnx.py", line 122, in tensorflow_to_onnx
    return tflist_to_onnx(graph.get_operations(), shape_override)
  File "/home/sneha/Downloads/tensorflow-onnx-master/tf2onnx/tfonnx.py", line 109, in tflist_to_onnx
    onnx_node = helper.make_node(node.type, input_names, output_names, name=node.name, **attr)
  File "/home/sneha/.local/lib/python3.5/site-packages/onnx/helper.py", line 56, in make_node
    for key, value in sorted(kwargs.items()))
  File "/home/sneha/.local/lib/python3.5/site-packages/onnx/helper.py", line 56, in <genexpr>
    for key, value in sorted(kwargs.items()))
  File "/home/sneha/.local/lib/python3.5/site-packages/onnx/helper.py", line 269, in make_attribute
    "You passed in an iterable attribute but I cannot figure out "
ValueError: You passed in an iterable attribute but I cannot figure out its applicable type.

我只有.pb文件和tf2onnx工具。

如果有人能给我时间回答这个问题,我会非常感激的!谢谢。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-10-20 13:19:13

我没有删除phase_train输入分支,这是错误的根源,我创建了仅推理图(转介-链接),然后它没有给我任何错误。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58470251

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档