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

Fixed deprecated stuff only to find it still doesn't work(yay) #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions onnx2tf.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
onnx_model = onnx.load("weights/export.onnx") # load onnx model
# output = prepare(onnx_model).run(input) # run the loaded model
# no strict to be faster
output = prepare(onnx_model, strict=False)
output = prepare(onnx_model, strict=True)

path = 'weights/yolov3.pb'

file = open(path, "wb")
file.write(output.graph.as_graph_def().SerializeToString())
#file.write(output.graph.as_graph_def().SerializeToString())
file.write(output.export_graph("exportpb"))
file.close()
11 changes: 7 additions & 4 deletions prep.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@

import pdb

tf.reset_default_graph()
graph_def = tf.GraphDef()
#tf.reset_default_graph()
tf.compat.v1.reset_default_graph()

#graph_def = tf.GraphDef()
graph_def = tf.compat.v1.GraphDef()
del_nodes = []
with tf.Session() as sess:
with tf.compat.v1.Session() as sess:
# Read binary pb graph from file
with tf.gfile.Open(graph_def_file, "rb") as f:
with tf.compat.v2.io.gfile.GFile(graph_def_file, "rb") as f:
data2read = f.read()
graph_def.ParseFromString(data2read)
tf.graph_util.import_graph_def(graph_def, name='')
Expand Down
Empty file modified weights/download_yolov3_weights.sh
100644 → 100755
Empty file.