google-research/tf-slim

tf_slim.layers.layers_test.LegacyFullyConnectedTest fail TF 2.1 but not 2.0.

tfboyd opened this issue · 8 comments

However, I pulled from master and cannot run the tests due to some import issues. Specifically with tf_sim.ops and more specifically with tf_slim.ops.arg_scope. Not sure if it's something on my side but I thought to bring it up.

Running from this branch on r2.0.0 is fine but running on r2.1.0 results in a test failure (tf_slim.layers.layers_test.LegacyFullyConnectedTest) as well.

From @adrianc-a and referenced in this PR: #1

I do not know if anyone on the team will look at this given the state of the project. But I created this and tagged Sergio in hope of some response or redirection. @sguada

@tfboyd thanks for creating the issue.

I observed the issue above on my fork on the branch remove_contrib however, I experience import issues trying to run the tests on the master branch of this repo regardless of tf version

@marksandler2 can you take a look

@adrianc-a does your comment still hold with the current state of master? Can you provide more detail?

@tfboyd i think we just need to remove this LegacyXXX business.

Hi all,
I'm testing the new commit with my use case in DeepVariant. I also had some import issues.
I'll report with an easier-to-reproduce scenario:

$ pip3 install --user git+https://github.com/google-research/tf-slim.git@master
$ python3 -c 'import tf_slim as slim'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/pichuan/.local/lib/python3.6/site-packages/tf_slim/__init__.py", line 25, in <module>
    from tf_slim.layers import *
  File "/home/pichuan/.local/lib/python3.6/site-packages/tf_slim/layers/__init__.py", line 25, in <module>
    from tf_slim.layers.layers import *
  File "/home/pichuan/.local/lib/python3.6/site-packages/tf_slim/layers/layers.py", line 30, in <module>
    from tf_slim.ops import variables
ModuleNotFoundError: No module named 'tf_slim.ops'

I can confirm that this problem didn't exist with my earlier branch:

$ pip3 install --user git+https://github.com/pichuan/tf-slim.git@remove_contrib
$ python3 -c 'import tf_slim as slim'

I haven't followed recent changes closely. Maybe we're missing an init.py file or something?

@marksandler2 Running on master (on 9731a32 )
./tests_release.sh produces the following error, which prevents the tests from running

======================================================================
ERROR: Failure: AttributeError ('module' object has no attribute 'ops')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/adrian/Documents/gsoc/orig/tf-slim/.eggs/nose-1.3.7-py2.7.egg/nose/loader.py", line 418, in loadTestsFromName
    addr.filename, addr.module)
  File "/Users/adrian/Documents/gsoc/orig/tf-slim/.eggs/nose-1.3.7-py2.7.egg/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/Users/adrian/Documents/gsoc/orig/tf-slim/.eggs/nose-1.3.7-py2.7.egg/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/Users/adrian/Documents/gsoc/orig/tf-slim/tf_slim/__init__.py", line 25, in <module>
    from tf_slim.layers import *
  File "/Users/adrian/Documents/gsoc/orig/tf-slim/tf_slim/layers/__init__.py", line 25, in <module>
    from tf_slim.layers.layers import *
  File "/Users/adrian/Documents/gsoc/orig/tf-slim/tf_slim/layers/layers.py", line 30, in <module>
    from tf_slim.ops import variables
  File "/Users/adrian/Documents/gsoc/final-merged/tf-slim/tf_slim/ops/__init__.py", line 7, in <module>
  File "/Users/adrian/Documents/gsoc/orig/tf-slim/tf_slim/ops/variables.py", line 24, in <module>
    import tf_slim.ops.arg_scope as arg_scope
AttributeError: 'module' object has no attribute 'ops'

I think it's the same issue @pichuan reported above. I see that the __init__.py files changed from my branch to master so I think that's the issue. I haven't looked for very long but there isn't an __init__.py in tf_slim/ops nor in tf_slim/training since it looks like this got changed from my pr to master.

the issue with LegacyFullyConnectedTest I notice on my fork/branch remove_contrib on tf r2.1.0.

Thanks, @adrianc-a. There were a lot of small changes to your original PR request since we had to make sure it passes all internal tests. However obviously we dropped the ball on external tests. Fixes coming shortly.

I believe this has been resolved and the tests now pass.