snowzach / doods

DOODS - Dedicated Open Object Detection Service
MIT License
303 stars 31 forks source link

Updating Tensorflow version #57

Closed EverythingSmartHome closed 2 years ago

EverythingSmartHome commented 3 years ago

Hey Zach! Thanks for this amazing add-on. I use it all the time!

I've been doing a lot of learning and got around to creating my own model, however when I load this into DOODs I'm getting an error Could not initialize detector sink-custom: could not load model models/custom.pb

If I convert this file to tflite and load that, I get: ERROR detector/detector.go:74 Could not initialize detector sink-custom: unsupported input tensor name: serving_default_input_tensor:0

And sometimes: Could not import model: Converting GraphDef to Graph has failed. The binary trying to import the GraphDef was built when GraphDef version was 175. The GraphDef was produced by a binary built when GraphDef version was 561. The difference between these versions is larger than TensorFlow's forward compatibility guarantee. The following error might be due to the binary trying to import the GraphDef being too old: NodeDef mentions attr 'explicit_paddings' not in Op<name=MaxPool; signature=input:T -> output:T; attr=T:type,default=DT_FLOAT,allowed=[DT_HALF, DT_BFLOAT16, DT_FLOAT, DT_DOUBLE, DT_INT32, DT_INT64, DT_UINT8, DT_INT16, DT_INT8, DT_UINT16, DT_QINT8]; attr=ksize:list(int),min=4; attr=strides:list(int),min=4; attr=padding:string,allowed=["SAME", "VALID"]; attr=data_format:string,default="NHWC",allowed=["NHWC", "NCHW", "NCHW_VECT_C"]>; NodeDef: {{node max_pool}}. (Check whether your GraphDef-interpreting binary is up to date with your GraphDef-generating binary.). {"package": "detector"}

Question is, is there any way for me to try and update to tensorflow 2.x? Do you think there would be compatibility issues? If there is a way to update, what is the best way for me to go about doing this?

Thanks again!

snowzach commented 3 years ago

Hi, so tensorflow lite requires a very specific version to be compatible with the EdgeTPU hardware device. That, thus far has been the version I have used. I figured at some point I may need to diverge between tensorflow and tensorflow lite. This may be it. I may have to rework the build pipeline for that though. I'm buried with other stuff, I'll try to take a look soon.

EverythingSmartHome commented 3 years ago

Sorry, perhaps I am mistaken, I'm not using the EdgeTPU (Coral?) device, just running on normal x86 hardware, does this still apply?

Perhaps I am mis-understanding!

snowzach commented 3 years ago

Yes it does still apply. I wanted the DOODS image to be compatible with EdgeTPU if you choose to use it which requires a newish but not totally up to date version of the Tensorflow Lite library. I use the same version for Tensorflow for compiling simplicity. I may change it such that Tensorflow Lite uses the EdgeTPU specific version otherwise it uses the latest Tensorflow library.

EverythingSmartHome commented 3 years ago

Gotcha, that makes total sense.

Let me know meantime if there is anything I can do on my side or if you want me to test anything, happy to help!

snowzach commented 2 years ago

Not sure if you still use DOODS but this has been updated to Tensorflow 2.7 in python. https://github.com/snowzach/doods2