Repository navigation
Closed
Labels
staleThis label marks the issue/pr stale - to be closed automatically if no activityThis label marks the issue/pr stale - to be closed automatically if no activitystat:awaiting responseStatus - Awaiting response from authorStatus - Awaiting response from authortype:build/installBuild and install issuesBuild and install issues
Description
i try using bazel to build on windows, but tips:
Have I written custom code No
OS Platform and Distribution WIN7 Visual Studio 2015
TensorFlow installed from source master
Bazel version 0.17.1
CUDA/cuDNN version CUDA9.0 / CUDNN 7.2.1
GPU model and memory 1080Ti / 11G
Mobile device N/A
Exact command to reproduce
- python ./configure.py
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.protobuf.UnsafeUtil (file:/C:/U
sers/tao/_bazel_tao/install/360a69cc0fef41d83a4dd948c0474ca5/_embedded_binaries/
A-server.jar) to field java.lang.String.value
WARNING: Please consider reporting this to the maintainers of com.google.protobu
f.UnsafeUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflect
ive access operations
WARNING: All illegal access operations will be denied in a future release
WARNING: --batch mode is deprecated. Please instead explicitly shut down your Ba
zel server using the command "bazel shutdown".
You have bazel 0.17.1 installed.
Please specify the location of python. [Default is C:\Users\tao\AppData\Local\Pr
ograms\Python\Python35\python.exe]:
Found possible Python library paths:
C:\Users\tao\AppData\Local\Programs\Python\Python35\lib\site-packages
Please input the desired Python library path to use. Default is [C:\Users\tao\A
ppData\Local\Programs\Python\Python35\lib\site-packages]
Do you wish to build TensorFlow with nGraph support? [y/N]:
No nGraph 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. [Leave empty to default to
CUDA 9.0]:
Please specify the location where CUDA 9.0 toolkit is installed. Refer to README
.md for more details. [Default is C:/Program Files/NVIDIA GPU Computing Toolkit/
CUDA/v9.0]:
Please specify the cuDNN version you want to use. [Leave empty to default to cuD
NN 7.0]:
Please specify the location where cuDNN 7 library is installed. Refer to README.
md for more details. [Default is C:/Program Files/NVIDIA GPU Computing Toolkit/C
UDA/v9.0]:
Please specify a list of comma-separated Cuda compute capabilities you want to b
uild 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: 3.5,7.0]:
Please specify optimization flags to use during compilation when bazel option "-
-config=opt" is specified [Default is /arch:AVX]:
Would you like to override eigen strong inline for some C++ compilation to reduc
e the compilation time? [Y/n]:
Eigen strong inline overridden.
2.bazel build --config=opt --config=cuda //tensorflow:libtensorflow.so
bazel build --config=opt --config=cuda //tensorflow:libtensorflow.so will be generated tensorflow.so and tensorflow.lib ?
Then rename the libtensorflow.so to tensorflow.dll, it can be work? @meteorcloudy
Metadata
Metadata
Assignees
Labels
staleThis label marks the issue/pr stale - to be closed automatically if no activityThis label marks the issue/pr stale - to be closed automatically if no activitystat:awaiting responseStatus - Awaiting response from authorStatus - Awaiting response from authortype:build/installBuild and install issuesBuild and install issues
Activity
[-]using bazel to build tensorflow on windows[/-][+]using bazel to build tensorflow on windows buid failed[/+][-]using bazel to build tensorflow on windows buid failed[/-][+]using bazel to build tensorflow.dll[/+]tensorflowbutler commentedon Sep 18, 2018
Thank you for your post. We noticed you have not filled out the following field in the issue template. Could you update them if they are relevant in your case, or leave them as N/A? Thanks.
TensorFlow version
taotaolin commentedon Sep 19, 2018
TensorFlow version master maybe r1.10
meteorcloudy commentedon Sep 19, 2018
Yes, it should work.
meteorcloudy commentedon Sep 19, 2018
You might find this script useful:
https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/ci_build/windows/libtensorflow_cpu.sh
taotaolin commentedon Sep 19, 2018
How should I choose to compile the debug version or the realse version?
meteorcloudy commentedon Sep 19, 2018
Debug: pass
-c debugor-c fastbuildRelease: pass
-c opttaotaolin commentedon Sep 20, 2018
i try using
bazel build --config=fastbuild --config=cuda //tensorflow:libtensorflow.soorbazel build --config=debug --config=cuda //tensorflow:libtensorflow.sobut it's have some mistake, tips:meteorcloudy commentedon Sep 20, 2018
Sorry, I meant you need to pass
-c debugor-c fastbuild, it's different from--configtaotaolin commentedon Sep 20, 2018
Thank you very much
53 remaining items
duocang commentedon Jul 7, 2019
@taotaolin hi. my question is how do we use tensorflow.dll? where can we find the functions inside? Or can you share some example?
taotaolin commentedon Jul 11, 2019
I have an example of MNIST recognition, which I can show you tomorrow.
taotaolin commentedon Jul 23, 2019
Please tell me your contact information
taotaolin commentedon Jul 26, 2019
It's too big. I put the code on github. The data set is MNIST.
MNIST_tensorflow_C
taotaolin commentedon Dec 6, 2019
ERROR LNK2019 . Have you resolved this problem? I don't seem to have solved this problem in the latest edition
AndreyOrb commentedon Dec 18, 2019
@Roffild You may replace the fatal message with this code, and it will work:
#if defined(PLATFORM_WINDOWS)
for (const char* dir : std::vector<const char*>(
{getenv("TEST_TMPDIR"), getenv("TMPDIR"), getenv("TMP"), getenv("TEMP"), "/tmp"})) {
if (!dir || !dir[0]) {
continue;
}
struct stat statbuf;
if (!stat(dir, &statbuf) && S_ISDIR(statbuf.st_mode)) {
string tmp_filepath;
tmp_filepath = io::JoinPath(
dir,
strings::StrCat("tmp_file_tensorflow_", UniqueId(), "_XXXXXX", extension));
//TODO Switch to secured method _mktemp_s
//int sizeInChars = strnlen(names[i], 9) + 1;
//int err = _mktemp_s( names[i], sizeInChars );
char* fd = _mktemp(&tmp_filepath[0]);
if (fd == nullptr) {
LOG(FATAL) << "Failed to create temp file.";
} else {
return tmp_filepath;
}
}
}
LOG(FATAL) << "No temp directory found.";
yuc8939 commentedon Feb 24, 2020
You may add
--copt=/w34716to the bazel build command line, e.g.bazel build --copt=/w34716 --experimental_shortened_obj_file_path //moco:mocoThis makes the MSVC compiler happy.
Inspired by: https://stackoverflow.com/a/11386226/12338026
kumariko commentedon Sep 16, 2021
@taotaolin We are checking to see if you still need help on this issue. We recommend that you upgrade to 2.6 which is latest stable version of TF and let us know if the issue still persists in newer versions. check comment: #22338 (comment) Thanks!'
google-ml-butler commentedon Sep 23, 2021
This issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Thank you.
google-ml-butler commentedon Sep 30, 2021
Closing as stale. Please reopen if you'd like to work on this further.
google-ml-butler commentedon Sep 30, 2021
Are you satisfied with the resolution of your issue?
Yes
No