Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

镜像环境运行报错 #19

Open
7aughing opened this issue Jun 1, 2021 · 3 comments
Open

镜像环境运行报错 #19

7aughing opened this issue Jun 1, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@7aughing
Copy link

7aughing commented Jun 1, 2021

您好,我把您的镜像拉到本地运行后,出现了如下错误
WARNING:tensorflow:From prep.py:19: The name tf.gfile.Open is deprecated. Please use tf.io.gfile.GFile instead.

Traceback (most recent call last):
File "prep.py", line 21, in
graph_def.ParseFromString(data2read)
google.protobuf.message.DecodeError: Error parsing messag
请问应该如何解决呢?

@7aughing 7aughing added the bug Something isn't working label Jun 1, 2021
@zldrobit
Copy link
Owner

zldrobit commented Jun 7, 2021

可否把你的操作步骤简要地贴出来,这样分析问题更方便。
WARNING是警告,按理不应该导致出错的。
从你的出错信息看,prep.py 21行是出错处,但master分支的代码是:

conv_nodes = [n for n in sess.graph.get_operations() if n.type in ['Conv2D','MaxPool','AvgPool']]
for n_org in conv_nodes:
# print(n_org.name, n_org.type)
# Transpose input
assert len(n_org.inputs)==1 or len(n_org.inputs)==2
org_inp_tens = sess.graph.get_tensor_by_name(n_org.inputs[0].name)
inp_tens = tf.transpose(org_inp_tens, [0, 2, 3, 1], name=n_org.name +'_transp_input')
op_inputs = [inp_tens]

master分支代码与你使用的代码不一致。
或许你可以尝试一下在拉去镜像后,重新git clone master分支,再跑一下转换。

@zldrobit
Copy link
Owner

zldrobit commented Jun 7, 2021

另外,如果你希望使用YOLOv5,也有对应的tensorflow转换代码:
ultralytics/yolov5#1127

@7aughing
Copy link
Author

7aughing commented Jun 7, 2021

我后续在转别的模型到tflite的时候,也遇到了这个问题,可能是环境的问题。我会按您的建议再试一下,谢谢!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants