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

Tensorflow version #11

Open
ingram-arginlerit opened this issue Jun 3, 2020 · 3 comments
Open

Tensorflow version #11

ingram-arginlerit opened this issue Jun 3, 2020 · 3 comments

Comments

@ingram-arginlerit
Copy link

Hello, this is looking to be perfect for the project I'm working on right now but encountered an issue with what seems to be the Tensorflow version dependency. I understand the TF version needs to be higher than 1.12 and I'm using 2.2 but there seems to have been changes to the TF syntax.

E.g. get_variable is now Variable, random_normal is now random.normal in the model.py file.

I tried to fix these and it worked but now I'm getting an error in a tensorflow file tensorflow\python\ops\variables.py Line 261: TypeError: _variable_v2_call() got an unexpected keyword argument 'initializer'.

Can you let me know please which specific Tensorflow version you used during the development?

@jasonrig
Copy link
Owner

jasonrig commented Jun 9, 2020

Oh dear, you are right. The TF version range in setup.py is bad!
At the time of development, it would have been 1.12 because I always set the version to be a minimum of the version I was using at the time of development. In this case, I forgot to set the upper limit to be less than version 2.0. There are definitely many breaking changes from TF 1.x to 2.x!

Please feel free to use any version up until 2.0 (v1.15 should be fine).

By the way, it should be possible to "transplant" the model weights into a TF 2.x project, but it would require a bit of work. So, if you want to use this project as-is (pre-trained models and all), I would suggest sticking to TF 1.x for the fastest result. If you want to build on this work, it could be that spending the time to port to TF 2.x is worthwhile.

As for your specific errors, I'd have to look into it more deeply (and I can't say when I will have time to do that). TF 2.x does have a compatibility API (https://www.tensorflow.org/api_docs/python/tf/compat/v1) that you might be able to use to bridge the gap between TF 1.x and 2.x.

@myndworks
Copy link

I also found the same issues as @ingram-arginlerit. I would love to upgrade this to TF 2.0 but I am quite new to TF and don't have enough knowledge to do it.

I have spun a Google colab and was able to successfully run it by downgrading to TF 1.15.0 as suggested by @jasonrig

Steps to run in Google Colab

1. !pip install address-net
2. !pip install tensorflow==1.15.0
3. copy the predict.py to ./content
4. !python ./content/predict.py

@Apoorvgarg-creator
Copy link

Apoorvgarg-creator commented Dec 22, 2021

@jasonrig, FixedLenFeature has moved from tf.FixedLenFeature into tf.io.FixedLenFeature.
This has been used in dataset.py.
Found this on the tensor flow website - Guide

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

No branches or pull requests

4 participants