通过遵循本教程https://www.youtube.com/watch?v=wQ8BIBpya2k,我开始了深度学习的第一步,直到我需要在jupyter笔记本中训练网络之前,一切都进行得很好。我几乎尝试了所有方法,并且总是收到此错误“ 内核似乎已经死亡。它将自动重新启动。”当我检查终端时,我可以看到
year
我要运行的代码非常简单(即使对于刚刚开始进行深度学习的我来说)
[I 18:32:24.897 NotebookApp] Adapting to protocol v5.1 for kernel 0d2f57af-46f5-419c-8c8e-9676c14dd9e3
2019-03-09 18:33:12.906756: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA
2019-03-09 18:33:12.907661: I tensorflow/core/common_runtime/process_util.cc:69] Creating new thread pool with default inter op setting: 4. Tune using inter_op_parallelism_threads for best performance.
OMP: Error #15: Initializing libiomp5.dylib, but found libiomp5.dylib already initialized.
OMP: Hint: This means that multiple copies of the OpenMP runtime have been linked into the program. That is dangerous, since it can degrade performance or cause incorrect results. The best thing to do is to ensure that only a single OpenMP runtime is linked into the process, e.g. by avoiding static linking of the OpenMP runtime in any library. As an unsafe, unsupported, undocumented workaround you can set the environment variable KMP_DUPLICATE_LIB_OK=TRUE to allow the program to continue to execute, but that may cause crashes or silently produce incorrect results. For more information, please see http://www.intel.com/software/products/support/.
[I 18:33:13.864 NotebookApp] KernelRestarter: restarting kernel (1/5), keep random ports
WARNING:root:kernel 0d2f57af-46f5-419c-8c8e-9676c14dd9e3 restarted
我尝试了所有的想法,并在google上解决了几乎所有相同的问题,现在这是我最后的希望,在此先感谢
答案 0 :(得分:1)
您下载了哪个版本的tensorflow?
从错误日志来看,似乎存在一些OpenMP库问题,我会尝试将Tensorflow重新安装到最新的稳定版本。
我必须更新我的tensorflow(1.13.1)安装程序才能使代码正常工作,这是我的输出。
coordinateLongPress
根据您使用的库管理器,尝试升级
对于Pip和Python3:
WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/tensorflow/python/ops/resource_variable_ops.py:435: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.
Instructions for updating:
Colocations handled automatically by placer.
Epoch 1/3
60000/60000 [==============================] - 6s 94us/sample - loss: 0.2652 - acc: 0.9213
Epoch 2/3
60000/60000 [==============================] - 6s 95us/sample - loss: 0.1103 - acc: 0.9660
Epoch 3/3
60000/60000 [==============================] - 6s 100us/sample - loss: 0.0735 - acc: 0.9765
10000/10000 [==============================] - 0s 35us/sample - loss: 0.0875 - acc: 0.9731
0.08748154099322855
0.9731
对于Anaconda:
pip3 install tensorflow --upgrade
然后运行
conda update tensorflow
要验证您是否拥有最新的
答案 1 :(得分:0)
我尝试了各种线程中建议的多个选项-升级matplotlib,将matplotlib降级到2.x.x版本,将TensorFlow升级到1.13.1,等等。对我来说,即使像下面这样的简单虚拟图,在Keras中调用fit方法后,一旦遇到图方法,也会因“ OMP:错误#15”而失败。
acc = [i for i in range(20) ]
epochs = range(1, len(acc) + 1)
loss = range(1, len(acc) + 1)
plt.plot(epochs, loss, 'bo', label='Training loss')
此Post中的建议对我有用。
conda install nomkl
答案 2 :(得分:0)
更新您的tensorflow软件包并重新启动机器。另外,请确保已激活一个内核,然后再次运行代码。那应该可以解决问题。
要使用pip升级张量流,请使用以下命令
pip install tensorflow --upgrade
对于pip3,使用
pip3 install tensorflow --upgrade
对于conda,使用
conda update tensorflow