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/contrib module still tries to import cloud even when TF is compiled without GCP support #29617

Closed
erwa opened this issue Jun 10, 2019 · 6 comments
Assignees
Labels
subtype:bazel Bazel related Build_Installation issues type:build/install Build and install issues

Comments

@erwa
Copy link

erwa commented Jun 10, 2019

Please make sure that this is a build/installation issue. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:build_template

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): RHEL 7.3
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: n/a
  • TensorFlow installed from (source or binary): source
  • TensorFlow version: 1.13.1
  • Python version: 3.7
  • Installed using virtualenv? pip? conda?: pip
  • Bazel version (if compiling from source): 0.21.0
  • GCC/Compiler version (if compiling from source): 6.3.1
  • CUDA/cuDNN version: n/a
  • GPU model and memory: n/a

Describe the problem

It seems tensorflow.contrib will try to import cloud on an x86 machine even when TF is compiled without GCP support:

if os.name != "nt" and platform.machine() != "s390x":
  from tensorflow.contrib import cloud

I build TF with --config=nogcp which causes the cloud module NOT to be included in the pip package. But then when tensorflow.contrib is importing, you get ImportError: cannot import name 'cloud' from 'tensorflow.contrib'.

Provide the exact sequence of commands / steps that you executed before running into the problem

Build TF with --config=nogcp:

bazel build --config=nogcp //tensorflow/tools/pip_package:build_pip_package

Install the pip package, start Python, and run import tensorflow.contrib.

Any other info / logs
Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.

@gadagashwini-zz gadagashwini-zz self-assigned this Jun 11, 2019
@gadagashwini-zz gadagashwini-zz added type:build/install Build and install issues subtype:bazel Bazel related Build_Installation issues labels Jun 11, 2019
@jvishnuvardhan jvishnuvardhan added the stat:awaiting tensorflower Status - Awaiting response from tensorflower label Jun 20, 2019
@mihaimaruseac
Copy link
Collaborator

Can you try with 1.14 which was just released yesterday?

@tensorflowbutler tensorflowbutler removed the stat:awaiting tensorflower Status - Awaiting response from tensorflower label Jun 20, 2019
@erwa
Copy link
Author

erwa commented Jun 20, 2019

Hi @mihaimaruseac,

I haven't tried with 1.14 but I imagine the problem still exists looking at the code: https://github.com/tensorflow/tensorflow/blob/r1.14/tensorflow/contrib/__init__.py#L30-L31

I worked around the issue by changing those lines to:

if os.name != "nt" and platform.machine() != "s390x" and platform.machine() != "x86_64":
  from tensorflow.contrib import cloud

as I'm building and running on an x86_64 machine.

@Zhiqiang-Ye
Copy link

@mihaimaruseac 1.14 still has this issue. I used @erwa 's workaround to get tensorflow working.

@ppwwyyxx
Copy link
Contributor

I'm running in the same issue, building TF r1.14 with the following flags:

--config=xla --config=mkl --config=noaws --config=nogcp --config=nohdfs --config=nokafka --config=noignite --config=numa

@gunan

@samhithaaaa
Copy link

Screen Shot 2019-08-27 at 10 37 49 AM
I too face the same issue with tensorflow1.14 version .Can someone please help

@jw447
Copy link

jw447 commented Sep 9, 2019

Same problem here for mac. I think for mac, os.name = 'posix'. Do I need to import cloud to run tensorflow on mac? I built tensorflow 1.13 with --config=nogcp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
subtype:bazel Bazel related Build_Installation issues type:build/install Build and install issues
Projects
None yet
Development

No branches or pull requests

9 participants