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

Does not work with TensorFlow versions >= 1.3 #1

Open
WeitaoVan opened this issue Dec 7, 2017 · 11 comments
Open

Does not work with TensorFlow versions >= 1.3 #1

WeitaoVan opened this issue Dec 7, 2017 · 11 comments

Comments

@WeitaoVan
Copy link

WeitaoVan commented Dec 7, 2017

Thanks for your inspiring idea and the corresponding code.

I try to run the tensorflow code train_cifar10.py.
But it takes more than 2 hours to construct the computational graph and I'm still stuck here.
The screen does not print any thing.
If I replace the CNNs in the original code with a plain ResNet-32 (without Weight Normalization or other tricks), the whole code goes on well.

Do you know what might be wrong?

Thanks.

@tarvaina
Copy link
Contributor

tarvaina commented Dec 8, 2017

Hi and thanks for the comment.

Which TF version are you using? The newest version seems to hang up in the way you describe. TF 1.2.1 should work.

I think the issue is in either weight norm or ema model code or maybe their combination. Unfortunately I haven’t had time to hunt it down. PRs welcome if you figure it out.

@WeitaoVan
Copy link
Author

I changed to TF 1.2.1. Now it works fine.
Thank you!

@tarvaina
Copy link
Contributor

Nice! Thanks for your comment.

@tarvaina tarvaina reopened this Jan 3, 2018
@tarvaina tarvaina changed the title tensorflow train_cifar10.py very slow Does not work with TensorFlow versions >1.2.x Jan 3, 2018
@tarvaina tarvaina changed the title Does not work with TensorFlow versions >1.2.x Does not work with TensorFlow versions >= 1.3 Jan 3, 2018
@tarvaina
Copy link
Contributor

tarvaina commented Feb 7, 2018

See the discussion in pull request #5. This is related to the data-dependent initialization of weight-normalized layers.

Smart variable initialization appears to be broken in TensorFlow since 1.3, and may get fixed in the next release. Here's the currently active bug report in TensorFlow issues: TensorFlow variable initializers broken #13351. As a possible workaround, here's a smarter initialization scheme from OpenAI: smart_initialize.py.

@liuajian
Copy link

your python --version? @WeitaoVan

@liuajian
Copy link

I can not download the tf1.2.x with python3.x

@tarvaina
Copy link
Contributor

I think I used both Python 3.5 and 3.6 in the development of this, and TF 1.2.x.

@LuJyKa
Copy link

LuJyKa commented Jul 3, 2018

On Tensorflow 1.8, I found a workaround:
There is a process to ensure no cycle dependencies, but cost a lot of time.

Comment the line 851&852 around in pyfolder/Lib/site-packages/tensorflow/python/ops/variables.py:

    def has_cycle(op, path):
      """Detect cycles in the dependencies of `initial_value`."""
      if op.name in path:
        return True
      path.add(op.name)
      for op_input in op.inputs:
        if has_cycle(op_input.op, path):
          return True
      for op_control_input in op.control_inputs:
        if has_cycle(op_control_input, path):
          return True
      path.remove(op.name)
      return False
    # if has_cycle(initial_value.op, path=set()):  # <--- comment this
    #   return initial_value  # <--- comment this

    return self._safe_initial_value_from_tensor(initial_value, op_cache={})

@liangzimei
Copy link

tf 1.2.0 has a bug using dropout , see here . tf 1.2.1 is ok.

@rajneo
Copy link

rajneo commented Oct 4, 2018

Tried running svhn.py.
No output shown for atleast 2hrs.
Using tensorflow 1.2.1

Do you know what might be wrong

@Xiaotian0726
Copy link

I can not download the tf1.2.x with python3.x

Tensorflow 1.x is not available for python 3.8, use python 3.5 and 3.6 instead. See more at issue #39768 of tensorflow

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

7 participants