Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

edgarriba
Copy link
Member

No description provided.

…dnn#254)

* necessary proto for parser weights and graph from TensorFlow

* necessary proto for parser weights and graph from TensorFlow

* tensor graph loader

* clean unnecessary files

* model generator of alexnet and squeezenet

* nodes parser for inception and squeezenet model

* applicble training for sqnet

* value detail and training

* value statistic in nodes and transformation to tiny-cnn initial

* output all useful info in proto

* clear representation

* all values in protofiles could be deserialized

* float Tensors bugfix

* layer transfer

* layer transfer

* remove unmature api in example of pb parser

* remove abundant codes

* transforming to io

* inline add and remove unnecessary messages
@mention-bot
Copy link

@edgarriba, thanks for your PR! By analyzing the history of the files in this pull request, we identified @beru, @nyanp and @wangyida to be potential reviewers.

@edgarriba edgarriba force-pushed the feat/tensorflow_parser branch from 9ad8416 to 40516bb Compare January 5, 2017 00:26
@edgarriba edgarriba force-pushed the feat/tensorflow_parser branch from 40516bb to e8dc8c3 Compare January 5, 2017 00:31
@edgarriba
Copy link
Member Author

@wangyida I have some problems with *.proto file path since some of them depends on others. Any tip how we can easily fix it?

#include <sstream>
#include <string>
#include <map>
#include "tensorflow/core/framework/graph.pb.h"
Copy link
Contributor

Choose a reason for hiding this comment

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

This one is definetely doesn't exists

Copy link
Member Author

Choose a reason for hiding this comment

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

it's supposed that's generated during the cmake configuration by the proto compiler

#include <sstream>
#include <string>
#include <map>
#include "tensorflow/core/framework/graph.pb.h"
Copy link
Contributor

@bhack bhack Jan 5, 2017

Choose a reason for hiding this comment

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

How could we maintain versioning of all this Tensorflow files?

@bhack
Copy link
Contributor

bhack commented Jan 5, 2017

I don't know if the list of TF protobuf files introduced it is minimal

@wangyida
Copy link
Contributor

@edgarriba for compiling problems with .proto files, you can have a try for:

protoc -I=..  --cpp_out=.. ../tiny_dnn/io/tensorflow/tensorflow/core/framework/*.proto

This is similar to my previous shell script for generating headers and sources from .proto files using protoc, you can find it Here
The last merged PR is there including all tools for parsing and loading, it is missed in current master branch. Is it suitable to be merged again?

@edgarriba
Copy link
Member Author

@wangyida I know the existence of our script to generate the proto files, however I want to simplify things and do it from CMake as it's done with Caffe
https://github.com/tiny-dnn/tiny-dnn/blob/master/examples/caffe_converter/CMakeLists.txt#L8

@wangyida
Copy link
Contributor

@edgarriba OK, let me have a check on CMakeList style, I just came back from Xiamen:) The current CMake checking strategy also have bugs.

@edgarriba
Copy link
Member Author

@wangyida oks. Feel free to commit in this branch

@wangyida
Copy link
Contributor

@edgarriba I had a try on the graph brach with tensorflow model parser and find that there might be some problem generating headers and source files within cmake from subdirectory, it's declared officially there in cmake doc

NOTE: The PROTOBUF_GENERATE_CPP macro & add_executable() or add_library()
calls only work properly within the same directory.

@wangyida
Copy link
Contributor

So I think maybe it's also applicable to call shell command within cmakelist

@bhack
Copy link
Contributor

bhack commented Jan 17, 2017

Cannot we add a CmakeList subdirectory file? What is the behaviour that we want on make install?

@edgarriba
Copy link
Member Author

I think that there are two possible cases for caffe/tensorflow converters:

  1. The user (or library) already has the proto files
  2. The user (or library) does not have the proto files

For case 1) we can assume that they at the correct place so there's no problem.
For case 2) I think that we should provide this CMake script in order to generate and point the proto files to the included directories (as is done now with the caffe_converter). I don't think that we have to include (physically) the files inside the project, instead generating them inside the build directory during the compilation could be enough so that we keep the library free of temporal files (and possible bugs like after compiling with different PROTOC version).

Regarding installation, if we behave in this way and we generate the proto files each time during the compilation we can avoid the mentioned problems.

@bhack
Copy link
Contributor

bhack commented Jan 17, 2017

Ok so what is the subdirectory problem?

@wangyida
Copy link
Contributor

As for the updating strategy of TensorFlow, the case should be case 2, only .proto files should be given into tiny-dnn.
The problem is that PROTOBUY_GRNERATR_CPP doesn't complie proto files at this time, so protoc is not executed there. We should add add_dependency(tensorflow_parser proto_source proto_header) to ensure that our target need the generated c++ files for linking. Here is a solution that we declare it in advance and complie it before linking it with target in cmakelist file, let me have a try on this way.

@bhack
Copy link
Contributor

bhack commented Jan 17, 2017

Ok but I don't fully understand the scope. We want a futher tensorflow_converter like caffe one so we have this linking dependencies only there.. or we want also in user apps?

@bhack
Copy link
Contributor

bhack commented Jan 17, 2017

So the main issue is we want to use converters to reserialize models in tiny-dnn format?

@wangyida
Copy link
Contributor

This converter is used for loading tf models and graphs stored in protobuf files, there is a parser in graph branch used for loading TF parametric model into memory.

There are no API for reserializing Parametric models into tiny-dnn models currently even we have all graphical relationships and parameter values

@bhack
Copy link
Contributor

bhack commented Jan 17, 2017

Yes I know but I am talking of the roadmap. Do we want to use for creating our standalone tool that produce serialized tiny-dnn models from TF or to work in memory with third-party developed apps?

@edgarriba
Copy link
Member Author

closing this since @wangyida has already another PR
#522

@edgarriba edgarriba closed this Feb 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants