下面是我用建立在MacOS
先决条件
- 安装巴泽勒
- 安装CUDA 8.0
- 克隆tensorflow程序到〜/ git的/ tensorflow
Then
cd ~/git/tensorflow
git fetch --all
brew upgrade bazel
git stash
git rebase tf/master
git stash pop
# to resolve conflict from previous ./configure run
git checkout --theirs -- tensorflow/core/platform/default/build_config.bzl
# do the actual build in TMUX session to avoid losing state when closing terminal
tmux new-session -s bazel -n 0
cd ~/git/tensorflow
./configure
export CUDA_VISIBLE_DEVICES=
export CUDA_HOME=/usr/local/cuda
export DYLD_LIBRARY_PATH=/usr/local/cuda/lib:/usr/local/cuda/extras/CUPTI/lib
export LD_LIBRARY_PATH=$DYLD_LIBRARY_PATH
export PATH=$DYLD_LIBRARY_PATH:$PATH
export date=feb11
export tag=head
export flags="--config=cuda --config=opt -k --action_env PATH --action_env DYLD_LIBRARY_PATH --action_env LD_LIBRARY_PATH"
bazel build $flags -k //tensorflow/tools/pip_package:build_pip_package
rm -Rf /tmp/tensorflow_pkg
mkdir /tmp/tensorflow_pkg
bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
mkdir -p ~/g/tfbins/$date.$tag
cp `find /tmp/tensorflow_pkg -type f ` ~/tfbins/$date.$tag
这将降低你的车轮文件到~/tfbins/feb11.head
您可以通过使用类似 https://github.com/yaroslavvb/stuff/blob/master/configure_tf.sh
注意自动./configure
部分,在Mac OS CUDA建筑物与最新巴泽勒发布打破,现在,你需要降级到0.4 0.3或从头脑中建立巴泽勒如果你想CUDA - https://github.com/tensorflow/tensorflow/issues/7227
然后,您可以这样公开分享车轮(设置的gsutil第一,选择不同的$桶)
export wheel=`find ~/tfbins/$date.$tag -type f`
export basename=`find ~/tfbins/$date.$tag -type f -printf "%f\n"`
cd ~/tfbins/$date.$tag
fullname=$date.$tag.$basename
ln -s $basename $fullname
export bucket=tensorflow-community-wheels
gsutil cp $fullname gs://$bucket
gsutil acl set public-read gs://$bucket/$fullname
echo https://storage.cloud.google.com/$bucket/$fullname
然后分享从最后一行打印的链接到https://github.com/yaroslavvb/tensorflow-community-wheels :)
你是哪个包,通过'pip install'安装的?如果你安装了那个,那么它很可能在'/ Library/Python/2.7/site-packages'中(这通常是'pip'在'macOS/OS X'上存储它的包的地方)。 –
'find〜-name'tensorflow-1.0.0-py2-none-any.whl''应该显示位置。您可能需要将搜索位置从'〜'更改为'/ tmp'或'/'。 – jww