我正在用bazel从源代码构建张量流,如下所述:
https://www.tensorflow.org/install/install_sources
在安装文档之后,我使用以下代码成功编译:
bazel build -c opt --copt=-mavx --copt=-mavx2 --copt=-mfma --copt=-mfpmath=both \
--cxxopt="-D_GLIBCXX_USE_CXX11_ABI=0"--config=cuda \
-k //tensorflow/tools/pip_package:build_pip_package
Run Code Online (Sandbox Code Playgroud)
这里接受的答案和安装文档中的注释"添加--cxxopt="-D_GLIBCXX_USE_CXX11_ABI=0"到gcc 5及更高版本的构建命令"的组合.
但是,会import tensorflow as tf导致错误
illegal instruction (core dumped), exiting python.
Run Code Online (Sandbox Code Playgroud)
我还试过:conda update libgcc无济于事.
如何使用gcc 5.0从源代码构建tensorflow?
我正在尝试训练一个 Tensorflow 卷积神经网络,无论我运行程序的环境如何,我总是遇到一个神秘的错误。
在 Jupyter Notebook 中,内核会死掉。
在终端中,我得到“非法指令:4”而没有回溯。
在 Pycharm 中,我得到:“进程已完成,退出代码为 132(被信号 4:SIGILL 中断)”。
我查看了整个互联网,但没有发现在这种情况下抛出此特定错误的任何实例。如果有人可以帮助阐明此错误,我将不胜感激。
我正在使用 Mac OS X High Sierra 和 python 3.6.2
我的代码可以在下面找到,正如我之前所说,没有回溯。
import tensorflow as tf
import numpy as np
import pandas as pd
# OS to load files and save checkpoints
import os
image_height = 60
image_width = 1
image1_height = 15
image2_width = 1
model_name = "tensorflowCNN"
train_data = np.asarray(pd.read_csv("/home/student/Desktop/TrainingInput.csv", usecols=[1]))
lis = train_data.tolist()
lis = lis[0:60]
lis = [x[0].strip('[]\n,') for x in lis]
nlis …Run Code Online (Sandbox Code Playgroud) python pycharm conv-neural-network tensorflow jupyter-notebook