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

No module named tensorflow.python.platform #16264

Closed
abratchik opened this issue Jan 21, 2018 · 3 comments
Closed

No module named tensorflow.python.platform #16264

abratchik opened this issue Jan 21, 2018 · 3 comments

Comments

@abratchik
Copy link

abratchik commented Jan 21, 2018

System information

OS
Linux 4.4.0-109-generic 132-Ubuntu SMP Tue Jan 9 19:52:39 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
VERSION="16.04.3 LTS (Xenial Xerus)"
VERSION_ID="16.04"
VERSION_CODENAME=xenial
Tensorflow
Installed from source (git clone from this repository):
tf.VERSION = 1.5.0-rc1
tf.GIT_VERSION = v1.5.0-rc1-1379-g20f6af3
tf.COMPILER_VERSION = v1.5.0-rc1-1379-g20f6af3
Sanity check: array([1], dtype=int32)
Python version
Python 2.7.12
**Bazel version **
Build label: 0.9.0
GCC/Compiler version
gcc (Ubuntu 5.4.1-2ubuntu1~16.04) 5.4.1 20160904
nvcc Cuda compilation tools, release 9.1, V9.1.85
CUDA/cuDNN version
CUDA Version 9.1.85
cuDNN Version 7.0.5
GPU model and memory
GeForce 1080 Ti 11Gb
Driver Version: 387.26
Exact command to reproduce

  1. git clone https://github.com/tensorflow/tensorflow
  2. ./configure
WARNING: Running Bazel server needs to be killed, because the startup options are different.
You have bazel 0.9.0 installed.
Please specify the location of python. [Default is /usr/bin/python]: 


Found possible Python library paths:
  /usr/local/lib/python2.7/dist-packages
  /usr/lib/python2.7/dist-packages
Please input the desired Python library path to use.  Default is [/usr/local/lib/python2.7/dist-packages]
/usr/lib/python2.7/dist-packages
Do you wish to build TensorFlow with jemalloc as malloc support? [Y/n]: n
No jemalloc as malloc support will be enabled for TensorFlow.

Do you wish to build TensorFlow with Google Cloud Platform support? [Y/n]: n
No Google Cloud Platform support will be enabled for TensorFlow.

Do you wish to build TensorFlow with Hadoop File System support? [Y/n]: 
Hadoop File System support will be enabled for TensorFlow.

Do you wish to build TensorFlow with Amazon S3 File System support? [Y/n]: n
No Amazon S3 File System support will be enabled for TensorFlow.

Do you wish to build TensorFlow with XLA JIT support? [y/N]: 
No XLA JIT support will be enabled for TensorFlow.

Do you wish to build TensorFlow with GDR support? [y/N]: 
No GDR support will be enabled for TensorFlow.

Do you wish to build TensorFlow with VERBS support? [y/N]: 
No VERBS support will be enabled for TensorFlow.

Do you wish to build TensorFlow with OpenCL SYCL support? [y/N]: 
No OpenCL SYCL support will be enabled for TensorFlow.

Do you wish to build TensorFlow with CUDA support? [y/N]: y
CUDA support will be enabled for TensorFlow.

Please specify the CUDA SDK version you want to use, e.g. 7.0. [Leave empty to default to CUDA 9.0]: 9.1


Please specify the location where CUDA 9.1 toolkit is installed. Refer to README.md for more details. [Default is /usr/local/cuda]: 


Please specify the cuDNN version you want to use. [Leave empty to default to cuDNN 7.0]: 7.0.5


Please specify the location where cuDNN 7.0.5 library is installed. Refer to README.md for more details. [Default is /usr/local/cuda]:


Please specify a list of comma-separated Cuda compute capabilities you want to build with.
You can find the compute capability of your device at: https://developer.nvidia.com/cuda-gpus.
Please note that each additional compute capability significantly increases your build time and binary size. [Default is: 6.1]


Do you want to use clang as CUDA compiler? [y/N]: 
nvcc will be used as CUDA compiler.

Please specify which gcc should be used by nvcc as the host compiler. [Default is /usr/bin/gcc]: 


Do you wish to build TensorFlow with MPI support? [y/N]: 
No MPI support will be enabled for TensorFlow.

Please specify optimization flags to use during compilation when bazel option "--config=opt" is specified [Default is -march=native]: 


Would you like to interactively configure ./WORKSPACE for Android builds? [y/N]: 
Not configuring the WORKSPACE for Android builds.

Preconfigured Bazel build configs. You can use any of the below by adding "--config=<>" to your build command. See tools/bazel.rc for more details.
	--config=mkl         	# Build with MKL support.
	--config=monolithic  	# Config for mostly static monolithic build.
Configuration finished
  1. bazel build --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package --action_env="LD_LIBRARY_PATH=${LD_LIBRARY_PATH}"

Target //tensorflow/tools/pip_package:build_pip_package up-to-date:
  bazel-bin/tensorflow/tools/pip_package/build_pip_package
INFO: Elapsed time: 1505.551s, Critical Path: 92.22s
INFO: Build completed successfully, 6091 total actions 
  1. bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg

Sun Jan 21 09:39:44 +04 2018 : === Output wheel file is in: /tmp/tensorflow_pkg

  1. sudo pip install /tmp/tensorflow_pkg/tensorflow-1.5.0rc1-cp27-cp27mu-linux_x86_64.whl
Installing collected packages: tensorflow-tensorboard, tensorflow
Successfully installed tensorflow-1.5.0rc1 tensorflow-tensorboard-0.4.0
  1. start python & post 'import tensorflow as tf' command
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "tensorflow/__init__.py", line 24, in <module>
    from tensorflow.python import *
  File "tensorflow/python/__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "tensorflow/python/pywrap_tensorflow.py", line 25, in <module>
    from tensorflow.python.platform import self_check
ImportError: No module named platform
@abratchik
Copy link
Author

abratchik commented Jan 23, 2018 via email

@abratchik
Copy link
Author

abratchik commented Jan 24, 2018

no idea mate ) Basically it looks like you can use the tensorflow from any directory except the one where you run the build scripts.

@changwuxie
Copy link

@abratchik you are right

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

3 participants
@abratchik @changwuxie and others