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

Feature request: Inception v3 MetaGraph #5036

Closed
Hvass-Labs opened this issue Oct 18, 2016 · 54 comments
Closed

Feature request: Inception v3 MetaGraph #5036

Hvass-Labs opened this issue Oct 18, 2016 · 54 comments
Labels
stat:contribution welcome Status - Contributions welcome type:feature Feature requests

Comments

@Hvass-Labs
Copy link
Contributor

Would it be possible for the TensorFlow developers to put a tar-ball online with the Inception v3 saved as a MetaGraph? I can't find it anywhere.

I'm currently using the following tar-ball with a frozen graph for Inception v3:

http://download.tensorflow.org/models/image/imagenet/inception-2015-12-05.tgz

The problem is that I cannot continue training that graph because it is frozen, so all the variables have been converted to constants before it was saved. I can't find a way to convert the constants back to variables so I don't think that is possible. (There are also some deprecation warnings regarding BatchNormWithGlobalNormalization so it will presumably stop working at some point in the future).

After searching for a solution for days, I found that you have released a newer checkpoint-file for Inception v3:

http://download.tensorflow.org/models/image/imagenet/inception-v3-2016-03-01.tar.gz

I downloaded it but it's only the checkpoint-file, not the graph-definition. So in my Python code I would apparently have to create the Inception graph using this function first:

https://github.com/tensorflow/models/blob/master/inception/inception/slim/inception_model.py#L52

But this apparently requires building TensorFlow from source, as far as I could understand from the README. There's also several options for using the function and it apparently has to be wrapped in arg_scopes and what-not:

https://github.com/tensorflow/models/blob/master/inception/inception/inception_model.py#L76-87

Would it be possible to update the above tar-ball (dated 2016-03-01) so it also contains the MetaGraph-files, so I can load it more easily and use it in my own Python program? I have another data-set so I replace the softmax-layer of the Inception-graph, and I also want to continue optimizing the rest of the variables of the Inception-graph.

Please also consider including a small example program in the tar-ball (or a link to some python-code), as it would make it a lot easier for everyone who wants to use it. Or at least make a list of all the relevant tensor-names (input, output, etc.)

Thanks!

@drpngx
Copy link
Contributor

drpngx commented Oct 24, 2016

@martinwicke any reason why we don't ship the graphs?

@martinwicke
Copy link
Member

martinwicke commented Oct 25, 2016 via email

@ryszard
Copy link

ryszard commented Oct 25, 2016

@martinwicke I am trying to do something very similar to what @Hvass-Labs is attempting.

The inception code in tensorflow/models is doing rather advanced stuff (using multiple GPUs, etc), which goes over the head of a beginner (like me), and it seems rather tightly coupled. What is more, it uses a (custom) version of slim, which not only makes the code look different than mainstream TF code, but also forces you to use blaze (not super pleasant if you aren't already using blaze for everything) – you cannot just drop one file into your repo and count it will work.

(Another source of confusion for me is that there's two versions of the slim inception: one in tensorflow/models, and one in https://github.com/tensorflow/models/tree/master/inception/inception/slim, which are very similar, but slightly different).

The inception related code that's much more beginner friendly (and much less Google idiosyncratic) is the one used in https://www.tensorflow.org/versions/r0.9/how_tos/image_retraining/index.html. However, adapting it to training the full network has proven quite daunting (issues mentioned by @Hvass-Labs, like being frozen, etc).

So, getting the Metagraph would actually be very, very helpful. Some non-slim Python code would be even better, but I understand that the rewrite would be far from trivial.

@Hvass-Labs
Copy link
Contributor Author

Thanks for the input everyone.

I am using the Inception model in my tutorials and I try to keep them fairly simple. This means limiting each tutorial to only one or a few topics. The official tutorials have 10 topics in each tutorial which is an extremely steep learning curve for beginners. I've put the Inception model inside a Python module so it is encapsulated and can easily be loaded from different tutorials:

https://github.com/Hvass-Labs/TensorFlow-Tutorials/blob/master/inception.py

By far the easiest thing would be to replace a few lines in my inception.py with the following:

  • Download a newer tar-ball.
  • A few lines of code for loading the MetaGraph and Checkpoint.

This would be an elegant solution that I could easily explain in a tutorial.

For the end-user, there really is no reason to build the Inception graph all over again. It is quite messy and you can't make any changes to it, because then you cannot load the checkpoint anymore. Even tiny changes that are logically identical will break the checkpoint.

As far as I understand, the MetaGraph is already saved when you save the checkpoint. So it should be fairly trivial to update the tar-ball. Although I do understand that if you guys are under a lot of stress then there's a million 'fairly trivial' things that needs to be done.

Hopefully you'll see the usefulness of updating the tar-ball as it might help thousands of people who will be watching the tutorials in the following years. I've been stuck for 2 weeks now trying to obtain the MetaGraph so I'm hoping I can get it soon.

Cheers!

@jurastm
Copy link

jurastm commented Oct 28, 2016

Same about me. I need to use tar-ball in my project

@drpngx drpngx added the stat:contribution welcome Status - Contributions welcome label Oct 29, 2016
@paolodoors
Copy link

Hvass-Labs's tutorials are really great. It would be very helpful to have the MetaGraph available.

@jfhauris
Copy link

Hvass-Labs's tutorials are outstanding. Please provide the MetaGraph etc that he is requesting. Thanks, Jon

@chidochipotle
Copy link

Hvass-Labs's tutorials are amazing. Would be great if you could implement the MetaGraph so he can make tutorial 10. Thanks, Daniel

@Arora90
Copy link

Arora90 commented Jan 2, 2017

Hvass-Labs's tutorials are very helpful. Would be great if you could implement the MetaGraph.

@souterjk
Copy link

souterjk commented Jan 2, 2017

Bump for asking for a meta graph. It's become critical for me because the .pb file which is included with the tars of 2015's inception5h model appear to use an API which has since been deprecated

@Caspain
Copy link

Caspain commented Jan 24, 2017

Hvass-Labs's tutorials are outstanding. Please provide the MetaGraph etc that he is requesting.Everyone deeply appreciates his lessons. Kindly support his request
Thank You.

@aselle aselle added type:feature Feature requests and removed enhancement labels Feb 9, 2017
@prudhvinandan
Copy link

Hvass-Labs's tutorials are outstanding. Please provide the MetaGraph etc that he is requesting.

@karl596
Copy link

karl596 commented Feb 17, 2017

Hvass-Labs的教程非常出色。请提供他要求的MetaGraph等。

@Caspain
Copy link

Caspain commented Feb 17, 2017 via email

@jurastm
Copy link

jurastm commented Feb 17, 2017

@karl596 tensorflow 刚出了 v.1.0.
最新版应该有metagraph

@vshkola
Copy link

vshkola commented Mar 14, 2017

+1 for the really necessary feature.

@Caspain
Copy link

Caspain commented Mar 14, 2017 via email

@Caspain
Copy link

Caspain commented Mar 14, 2017 via email

@KoSv
Copy link

KoSv commented Mar 18, 2017

please support!

@Caspain
Copy link

Caspain commented Mar 18, 2017 via email

@evaliyev
Copy link

+1

2 similar comments
@ljubisap
Copy link

+1

@maximegmd
Copy link

+1

@merryHunter
Copy link

Please, support! +1

@attakorn1
Copy link

+1

@singhranjodh
Copy link

+1

12 similar comments
@shrikondra
Copy link

+1

@mueller91
Copy link

+1

@alwynmathew
Copy link

+1

@YaroslavSchubert
Copy link

+1

@tanayjha
Copy link

tanayjha commented May 4, 2017

+1

@gongenhao
Copy link

+1

@ram1993
Copy link

ram1993 commented May 12, 2017

+1

@bzhong2
Copy link

bzhong2 commented May 15, 2017

+1

@Vijayabhaskar96
Copy link

+1

@trojana
Copy link

trojana commented May 29, 2017

+1

@hzqjyyx
Copy link

hzqjyyx commented May 30, 2017

+1

@kencano
Copy link

kencano commented May 30, 2017

+1

@wgong
Copy link

wgong commented Jun 7, 2017

Hvass-Labs tensorflow tutorial is awesome, the best I can find, please support his pull request, so we can learn more about tensorflow from Hvass-Labs, Thank tensorflow team

@thorgeirk11
Copy link

+1

2 similar comments
@gnavihs
Copy link

gnavihs commented Jun 14, 2017

+1

@jematos92
Copy link

+1

@sguada
Copy link
Member

sguada commented Jun 20, 2017

Please use export_inference_graph to get the graph (see Docs)

@sguada sguada closed this as completed Jun 20, 2017
@ajinkyaT
Copy link

ajinkyaT commented Oct 3, 2017

+1

@sguada
Copy link
Member

sguada commented Oct 14, 2017

Fixed the links

@grankt
Copy link

grankt commented Oct 21, 2017

+1

7 similar comments
@AymanASamyM
Copy link

+1

@letuantang
Copy link

+1

@luongthomas
Copy link

+1

@letuantang
Copy link

+1

@omarg42
Copy link

omarg42 commented Nov 17, 2017

+1

@nimral
Copy link

nimral commented Nov 30, 2017

+1

@AbhiRepository
Copy link

+1

@Hvass-Labs
Copy link
Contributor Author

Thanks to everyone for supporting this issue!

The easiest solution is to just use Keras for doing Transfer Learning and Fine-Tuning in TensorFlow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stat:contribution welcome Status - Contributions welcome type:feature Feature requests
Projects
None yet
Development

No branches or pull requests