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

Tf v2.4.1 #44

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open

Conversation

jasonahills
Copy link

Updates tensorflow submodule to v2.4.1 tag so that we can have more supported operations.

Updates dependencies (and weakens version requirements).

@jasonahills
Copy link
Author

Once boncheolgu/tflite-rs-downloads#2 gets merged, we'll want to update the submodule to use the merge commit.

@jasonahills
Copy link
Author

Also, I should note that I'm seeing some warnings on the c++ side of things. How would you like me to handle them?

warning: In file included from /target/package/tflite-0.10.0/submodules/tensorflow/tensorflow/lite/interpreter.h:31:0,
warning:                  from src/interpreter/mod.rs:19:
warning: /target/package/tflite-0.10.0/submodules/tensorflow/tensorflow/lite/core/api/profiler.h: In member function ‘virtual void tflite::Profiler::EndEvent(uint32_t, int64_t, int64_t)’:
warning: /target/package/tflite-0.10.0/submodules/tensorflow/tensorflow/lite/core/api/profiler.h:73:34: warning: unused parameter ‘event_handle’ [-Wunused-parameter]
warning:    virtual void EndEvent(uint32_t event_handle, int64_t event_metadata1,
warning:                                   ^~~~~~~~~~~~
warning: /target/package/tflite-0.10.0/submodules/tensorflow/tensorflow/lite/core/api/profiler.h:73:56: warning: unused parameter ‘event_metadata1’ [-Wunused-parameter]
warning:    virtual void EndEvent(uint32_t event_handle, int64_t event_metadata1,
warning:                                                         ^~~~~~~~~~~~~~~
warning: /target/package/tflite-0.10.0/submodules/tensorflow/tensorflow/lite/core/api/profiler.h:74:33: warning: unused parameter ‘event_metadata2’ [-Wunused-parameter]
warning:                          int64_t event_metadata2) {}
warning:                                  ^~~~~~~~~~~~~~~
warning: /target/package/tflite-0.10.0/submodules/tensorflow/tensorflow/lite/core/api/profiler.h: In member function ‘virtual void tflite::Profiler::AddEvent(const char*, tflite::Profiler::EventType, uint64_t, uint64_t, int64_t, int64_t)’:
warning: /target/package/tflite-0.10.0/submodules/tensorflow/tensorflow/lite/core/api/profiler.h:91:37: warning: unused parameter ‘tag’ [-Wunused-parameter]
warning:    virtual void AddEvent(const char* tag, EventType event_type, uint64_t start,
warning:                                      ^~~
warning: /target/package/tflite-0.10.0/submodules/tensorflow/tensorflow/lite/core/api/profiler.h:91:52: warning: unused parameter ‘event_type’ [-Wunused-parameter]
warning:    virtual void AddEvent(const char* tag, EventType event_type, uint64_t start,
warning:                                                     ^~~~~~~~~~
warning: /target/package/tflite-0.10.0/submodules/tensorflow/tensorflow/lite/core/api/profiler.h:91:73: warning: unused parameter ‘start’ [-Wunused-parameter]
warning:    virtual void AddEvent(const char* tag, EventType event_type, uint64_t start,
warning:                                                                          ^~~~~
warning: /target/package/tflite-0.10.0/submodules/tensorflow/tensorflow/lite/core/api/profiler.h:92:34: warning: unused parameter ‘end’ [-Wunused-parameter]
warning:                          uint64_t end, int64_t event_metadata1,
warning:                                   ^~~
warning: /target/package/tflite-0.10.0/submodules/tensorflow/tensorflow/lite/core/api/profiler.h:92:47: warning: unused parameter ‘event_metadata1’ [-Wunused-parameter]
warning:                          uint64_t end, int64_t event_metadata1,
warning:                                                ^~~~~~~~~~~~~~~
warning: /target/package/tflite-0.10.0/submodules/tensorflow/tensorflow/lite/core/api/profiler.h:93:33: warning: unused parameter ‘event_metadata2’ [-Wunused-parameter]
warning:                          int64_t event_metadata2) {}
warning:                                  ^~~~~~~~~~~~~~~
warning: In file included from /target/package/tflite-0.10.0/submodules/tensorflow/tensorflow/lite/interpreter.h:32:0,
warning:                  from src/interpreter/mod.rs:19:
warning: /target/package/tflite-0.10.0/submodules/tensorflow/tensorflow/lite/core/subgraph.h: In member function ‘virtual uint32_t tflite::Subgraph::SubgraphAwareProfiler::BeginEvent(const char*, tflite::Profiler::EventType, int64_t, int64_t)’:
warning: /target/package/tflite-0.10.0/submodules/tensorflow/tensorflow/lite/core/subgraph.h:365:33: warning: unused parameter ‘event_metadata2’ [-Wunused-parameter]
warning:                          int64_t event_metadata2) override {
warning:                                  ^~~~~~~~~~~~~~~
warning: /target/package/tflite-0.10.0/submodules/tensorflow/tensorflow/lite/core/subgraph.h: In member function ‘virtual void tflite::Subgraph::SubgraphAwareProfiler::AddEvent(const char*, tflite::Profiler::EventType, uint64_t, uint64_t, int64_t, int64_t)’:
warning: /target/package/tflite-0.10.0/submodules/tensorflow/tensorflow/lite/core/subgraph.h:384:27: warning: unused parameter ‘event_metadata2’ [-Wunused-parameter]
warning:                    int64_t event_metadata2) override {
warning:                            ^~~~~~~~~~~~~~~
warning: In file included from /target/package/tflite-0.10.0/submodules/tensorflow/tensorflow/lite/interpreter_builder.h:25:0,
warning:                  from /target/package/tflite-0.10.0/submodules/tensorflow/tensorflow/lite/model.h:21,
warning:                  from src/interpreter/builder.rs:10:
warning: /target/package/tflite-0.10.0/submodules/tensorflow/tensorflow/lite/core/api/op_resolver.h: In member function ‘virtual tflite::OpResolver::TfLiteDelegatePtrVector tflite::OpResolver::GetDelegates(int) const’:
warning: /target/package/tflite-0.10.0/submodules/tensorflow/tensorflow/lite/core/api/op_resolver.h:43:52: warning: unused parameter ‘num_threads’ [-Wunused-parameter]
warning:    virtual TfLiteDelegatePtrVector GetDelegates(int num_threads) const {
warning:

Cargo.toml Outdated
@@ -20,19 +20,31 @@ include = [
"data/",
"csrc/",
"src/",
"submodules/downloads",
"submodules/downloads/ruy",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there are things in downloads that we don't need, we should drop them in the script, and keep this simple.

@@ -1,3 +1,4 @@

use super::{BuiltinOptions, BuiltinOptionsUnion, NativeTable};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this file had rustfmt run on it and that's why there's all the changes.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes in these _impl files come from when we run with the generate_model_apis feature on.

@@ -1,10 +1,11 @@
use std::ops::{Deref, DerefMut, Index, IndexMut};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rustfmt changes

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes come from building with the generate_model_apis feature on.

@@ -1,5 +1,6 @@
use std::ops::{Deref, DerefMut};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rustfmt changes

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes come from building with the generate_model_apis feature on.

@jasonahills
Copy link
Author

I see that the Jenkins builders have failed. It looks like I'll need to be less aggressive in the files that I remove to get the package size under the 10mb crates.io limit.

maybe-owned = "0.3.4"
thiserror = "1.0.20"
cpp = "0.5"
libc = "0.2"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Loosening these dependencies because we can rely upon semver for them.

@Michael-F-Bryan
Copy link

We were running into some issues where the TensorFlow Lite model we've been provided is too new for tflite to use (""ERROR: Op builtin_code out of range: 127").

@jasonahills and @tylerhawkes, is there anything I can do to help push this PR through?

@tylerhawkes
Copy link
Contributor

We still need to port all of the model code over to get it mergeable. As you can see, we've moved all of the inference code to using cxx and it all works great. The code to inspect and build models segfaults so it needs to use cxx as well and it's got the largest api surface area. Anything you can do on that would help out a lot. I can give you access to our branch if that will help out or you can make pull requests to our branch. We also have this published on cloudsmith. You'll need to add registries.vivint-public = { index = "https://dl.cloudsmith.io/public/vivint/public/cargo/index.git" } to your cargo config and add registry = "vivint-public" to the tflite dependency in Cargo.toml if you want to use that and all you need is the inference code.

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.

3 participants