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

Conversation

acidtonic
Copy link

Updated the code because it doesn't work with newer tensorflow.

output.graph.as_graph_def is an empty object.

tf.Session is gone.

The output graph is saved but requires a folder name and eventually found the pb file inside of it.

The step to run TOCO still doesn't work...

INFO: Build completed successfully, 1 total action
[libprotobuf ERROR external/com_google_protobuf/src/google/protobuf/text_format.cc:324] Error parsing text-format tensorflow.GraphDef: 1:1: Invalid control characters encountered in text.
[libprotobuf ERROR external/com_google_protobuf/src/google/protobuf/text_format.cc:324] Error parsing text-format tensorflow.GraphDef: 1:4: Interpreting non ascii codepoint 158.
[libprotobuf ERROR external/com_google_protobuf/src/google/protobuf/text_format.cc:324] Error parsing text-format tensorflow.GraphDef: 1:4: Expected identifier, got: �
2020-09-17 18:41:05.224753: F tensorflow/lite/toco/import_tensorflow.cc:2757] Check failed: ParseFromStringEitherTextOrBinary(input_file_contents, tf_graph.get())

But since I wasted time updating this thinking it would work, here's the pull request. Also, did I mention tensorflow is horrible?

@zldrobit
Copy link
Owner

@acidtonic Thanks for your PR, but I am not planning to support this repo for TF 2.x.
I found that the new TFLite experimental converter in TF 2.x is less error-prone than older TOCO.
I am developing a YOLOv5 converting code by using new TFLite experimental converter for TF 2.x and TF 1.x

@acidtonic
Copy link
Author

I took a look and seen nothing regarding darknet weights there on the readme.

What would be the invocation to convert a trained darknet yolov3 model over using tensorflow 2.x? I haven't moved to yolov4 or yolov5 yet.

@zldrobit
Copy link
Owner

zldrobit commented Sep 22, 2020

@acidtonic you can convert weights using TF 1.15 and infer converted networks with TF 2.x, but you may need extra code for compatibility.
You can also get tf.Session in TF 2.x by import tensorflow as v1

import tensorflow as tf
tf = tf.compat.v1

@acidtonic
Copy link
Author

That also isn't working, tensorflow_addons seems to only support 2.x, I can't find an old enough one for pip3 to install.

UserWarning: Tensorflow Addons supports using Python ops for all Tensorflow versions above or equal to 2.2.0 and strictly below 2.4.0 (nightly versions are not supported). 
 The versions of TensorFlow you are currently using is 1.15.0 and is not supported. 

@zldrobit
Copy link
Owner

@acidtonic Sorry for the really late response. You could use a docker image (docker pull zldrobit/onnx:10.0-cudnn7-devel) during conversion so that the environment is prepared, and run the converted model with a newer TensorFlow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants