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

Upgrading to TF 2.0 #8

Open
snehalstomar opened this issue Nov 23, 2021 · 0 comments
Open

Upgrading to TF 2.0 #8

snehalstomar opened this issue Nov 23, 2021 · 0 comments

Comments

@snehalstomar
Copy link

Hi!

I am trying to upgrade the GHFeat model to Tensorflow 2.2 from Tensorflow 1.2 for my project. To this end, I used the tf_upgrade_v2 provided in TF2.0. The function made several changes however, It omitted making changes to files in the "dnnlib/" directory. So I am having to do those manually.

There's one statement in "dnnlib/tflib/network.py" which returns an error when interpreted with TF2.0, which I not being able to fix. The troublesome statement is Line 291, given as below:
exec(self._build_module_src, module.__dict__) # pylint: disable=exec-used.
The error trace-back for the same is:
exec(self._build_module_src, module.__dict__) # pylint: disable=exec-used File "<string>", line 11, in <module> ModuleNotFoundError: No module named 'tensorflow.contrib'
I understand that I need to go to the file where module has been defined and change "tf.contrib." to "tf.compat.v1.contrib." / "tf_slim.". However since the trace-back mentions the filename as "String", I am not being able to figure out the file to which I need to make changes. I request the community and repository maintainers to kindly help me out in this regard.

So far, the following attempts of mine to fix this issue have failed:

  1. upgrading the Pickle PROTOCOL to 5
  2. following the steps given here
  3. trying out python's compile() function to figure out the path to the erroneous file

Looking forward to effective insights and discussions in this regard.

Thanks.

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

1 participant