pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

OMP:錯誤 #15:正在初始化 libiomp5.dylib,但發現 lib

OMP: Error #15: Initializing libiomp5.dylib, but found libiomp5.dylib already initialized(OMP:錯誤 #15:正在初始化 libiomp5.dylib,但發現 libiomp5.dylib 已初始化)
本文介紹了OMP:錯誤 #15:正在初始化 libiomp5.dylib,但發現 libiomp5.dylib 已初始化的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我正在嘗試運行一個測試程序來檢查我的 Anaconda 環境是否配置正確.但是,當我運行我的測試程序時,我會在程序設置圖形時收到此錯誤消息(準確地說是 on_train_end() 回調):

I'm trying to run a test program to check if my Anaconda environment is configured correctly. However, when I run my test program I get this error message when the program is setting up graph (on_train_end() callback to be precise):

OMP:錯誤 #15:正在初始化 libiomp5.dylib,但找到了 libiomp5.dylib已經初始化.OMP:提示 這意味著 OpenMP 運行時的多個副本已經存在,因為它會降低性能或導致不正確的結果.最好的辦法是確保只有一個 OpenMP 運行時鏈接到進程中,例如通過避免在任何庫中靜態鏈接 OpenMP 運行時.作為一種不安全、不受支持、未記錄的解決方法,您可以設置環境變量 KMP_DUPLICATE_LIB_OK=TRUE 以允許程序繼續執行,但這可能會導致崩潰或默默地產生不正確的結果.如需更多信息,請參閱 http://www.intel.com/software/products/support/.

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 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/.

我正在安裝 macOS Mojave 10.14.1 的 MacBook Pro 15" 2015 上運行測試程序.我目前安裝的 Anaconda 發行版是 https://repo.anaconda.com/archive/Anaconda2-5.3.0-MacOSX-x86_64.sh.

I'm running the test program on my MacBook Pro 15" 2015 where it is installed macOS Mojave 10.14.1. The Anaconda distribution that I have currently installed is https://repo.anaconda.com/archive/Anaconda2-5.3.0-MacOSX-x86_64.sh.

這是測試程序:

#!/usr/bin/env python

import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt

from tensorflow import keras

Xs = np.array([
    [0, 0],
    [0, 1],
    [1, 1],
    [1, 0]
])

Ys = np.array([
    [0],
    [1],
    [0],
    [1]
])

class MyCallback(keras.callbacks.Callback):
    def __init__(self):
        super(MyCallback, self).__init__()
        self.stats = []

    def on_epoch_end(self, epoch, logs=None):
        self.stats.append({
            'loss': logs['loss'],
            'acc': logs['acc'],
            'epoch': epoch
        })

    def on_train_end(self, logs=None):
        loss_x = []
        loss_y = []
        acc_x = []
        acc_y = []
        for e in self.stats:
            loss_x.append(e['epoch'])
            loss_y.append(e['loss'])
            acc_x.append(e['epoch'])
            acc_y.append(e['acc'])
        plt.plot(loss_x, loss_y, 'r', label='Loss')
        plt.plot(acc_x, acc_y, 'b', label='Accuracy')
        plt.xlabel('Epochs')
        plt.ylabel('Loss / Accuracy')
        plt.legend(loc='upper left')
        plt.show()

with tf.Session() as session:
    model = keras.models.Sequential()

    model.add(keras.layers.Dense(10, activation=keras.activations.elu, input_dim=2))
    model.add(keras.layers.Dense(1, activation=keras.activations.sigmoid))

    model.compile(optimizer=keras.optimizers.Adam(lr=0.05),
                  loss=keras.losses.mean_squared_error,
                  metrics=['accuracy'])

    model.fit(x=Xs, y=Ys, batch_size=4, epochs=50, callbacks=[MyCallback()])

    print("Training complete")

    loss, acc = model.evaluate(Xs, Ys)

    print(f"loss: {loss} - acc: {acc}")

    predictions = model.predict(Xs)

    print("predictions")
    print(predictions)

我已經嘗試參考 答案initial">this 相關問題.因此,在 import 部分之后添加以下代碼行:

I already tried to fix the issue referencing to the answer of this related question. Thus, adding the following lines of code after the import section:

import os
os.environ['KMP_DUPLICATE_LIB_OK'] = 'True'

我得到的是另一個錯誤消息,這是完整的堆棧跟蹤:

What I get is another error message, this is the full stack trace:

2018-12-06 10:18:34.262 python[19319:371282] -[NSApplication _setup:]: unrecognized selector sent to instance 0x7ff2b07a3d00
2018-12-06 10:18:34.266 python[19319:371282] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSApplication _setup:]: unrecognized selector sent to instance 0x7ff2b07a3d00'
*** First throw call stack:
(
        0   CoreFoundation                      0x00007fff2ccf0e65 __exceptionPreprocess + 256
        1   libobjc.A.dylib                     0x00007fff58d47720 objc_exception_throw + 48
        2   CoreFoundation                      0x00007fff2cd6e22d -[NSObject(NSObject) __retain_OA] + 0
        3   CoreFoundation                      0x00007fff2cc92820 ___forwarding___ + 1486
        4   CoreFoundation                      0x00007fff2cc921c8 _CF_forwarding_prep_0 + 120
        5   libtk8.6.dylib                      0x0000000b36aeb31d TkpInit + 413
        6   libtk8.6.dylib                      0x0000000b36a4317e Initialize + 2622
        7   _tkinter.cpython-36m-darwin.so      0x0000000b3686ba16 _tkinter_create + 1174
        8   python                              0x000000010571c088 _PyCFunction_FastCallDict + 200
        9   python                              0x00000001057f2f4f call_function + 143
        10  python                              0x00000001057f0abf _PyEval_EvalFrameDefault + 46847
        11  python                              0x00000001057e4209 _PyEval_EvalCodeWithName + 425
        12  python                              0x00000001057f3b1c _PyFunction_FastCallDict + 364
        13  python                              0x000000010569a8b0 _PyObject_FastCallDict + 320
        14  python                              0x00000001056c1fe8 method_call + 136
        15  python                              0x00000001056a1efe PyObject_Call + 62
        16  python                              0x0000000105743385 slot_tp_init + 117
        17  python                              0x00000001057478c1 type_call + 241
        18  python                              0x000000010569a821 _PyObject_FastCallDict + 177
        19  python                              0x00000001056a2a67 _PyObject_FastCallKeywords + 327
        20  python                              0x00000001057f3048 call_function + 392
        21  python                              0x00000001057f0b6f _PyEval_EvalFrameDefault + 47023
        22  python                              0x00000001057f330c fast_function + 188
        23  python                              0x00000001057f2fac call_function + 236
        24  python                              0x00000001057f0abf _PyEval_EvalFrameDefault + 46847
        25  python                              0x00000001057e4209 _PyEval_EvalCodeWithName + 425
        26  python                              0x00000001057f3b1c _PyFunction_FastCallDict + 364
        27  python                              0x000000010569a8b0 _PyObject_FastCallDict + 320
        28  python                              0x00000001056c1fe8 method_call + 136
        29  python                              0x00000001056a1efe PyObject_Call + 62
        30  python                              0x00000001057f0cc0 _PyEval_EvalFrameDefault + 47360
        31  python                              0x00000001057e4209 _PyEval_EvalCodeWithName + 425
        32  python                              0x00000001057f33ba fast_function + 362
        33  python                              0x00000001057f2fac call_function + 236
        34  python                              0x00000001057f0abf _PyEval_EvalFrameDefault + 46847
        35  python                              0x00000001057f330c fast_function + 188
        36  python                              0x00000001057f2fac call_function + 236
        37  python                              0x00000001057f0abf _PyEval_EvalFrameDefault + 46847
        38  python                              0x00000001057e4209 _PyEval_EvalCodeWithName + 425
        39  python                              0x00000001057f33ba fast_function + 362
        40  python                              0x00000001057f2fac call_function + 236
        41  python                              0x00000001057f0abf _PyEval_EvalFrameDefault + 46847
        42  python                              0x00000001057e4209 _PyEval_EvalCodeWithName + 425
        43  python                              0x00000001057f33ba fast_function + 362
        44  python                              0x00000001057f2fac call_function + 236
        45  python                              0x00000001057f0b6f _PyEval_EvalFrameDefault + 47023
        46  python                              0x00000001057e4209 _PyEval_EvalCodeWithName + 425
        47  python                              0x00000001057f33ba fast_function + 362
        48  python                              0x00000001057f2fac call_function + 236
        49  python                              0x00000001057f0abf _PyEval_EvalFrameDefault + 46847
        50  python                              0x00000001057e4209 _PyEval_EvalCodeWithName + 425
        51  python                              0x00000001057f33ba fast_function + 362
        52  python                              0x00000001057f2fac call_function + 236
        53  python                              0x00000001057f0abf _PyEval_EvalFrameDefault + 46847
        54  python                              0x00000001057e4209 _PyEval_EvalCodeWithName + 425
        55  python                              0x00000001057f33ba fast_function + 362
        56  python                              0x00000001057f2fac call_function + 236
        57  python                              0x00000001057f0b6f _PyEval_EvalFrameDefault + 47023
        58  python                              0x00000001057e4209 _PyEval_EvalCodeWithName + 425
        59  python                              0x00000001057f33ba fast_function + 362
        60  python                              0x00000001057f2fac call_function + 236
        61  python                              0x00000001057f0b6f _PyEval_EvalFrameDefault + 47023
        62  python                              0x00000001057e4209 _PyEval_EvalCodeWithName + 425
        63  python                              0x000000010583cd4c PyRun_FileExFlags + 252
        64  python                              0x000000010583c224 PyRun_SimpleFileExFlags + 372
        65  python                              0x0000000105862d66 Py_Main + 3734
        66  python                              0x0000000105692929 main + 313
        67  libdyld.dylib                       0x00007fff59e1608d start + 1
        68  ???                                 0x0000000000000002 0x0 + 2
)
libc++abi.dylib: terminating with uncaught exception of type NSException

這里是環境中安裝的相關依賴的列表(不相關的依賴為了簡潔省略):

Here is a list of the related dependencies installed in the environment (not related dependencies are omitted for brevity):

Name                |     Version                      Build
--------------------|----------------|----------------------
_tflow_select       |     2.3.0      |                   mkl
blas                |     1.0        |                   mkl
intel-openmp        |     2019.1     |                   144
matplotlib          |     3.0.1      |        py36h54f8f79_0
mkl                 |     2018.0.3   |                     1
mkl_fft             |     1.0.6      |        py36hb8a8100_0
mkl_random          |     1.0.1      |        py36h5d10147_1
numpy               |     1.15.4     |        py36h6a91979_0
numpy-base          |     1.15.4     |        py36h8a80b8c_0
tensorboard         |     1.12.0     |        py36hdc36e2c_0
tensorflow          |     1.12.0     |    mkl_py36h2b2bbaf_0
tensorflow-base     |     1.12.0     |    mkl_py36h70e0e9a_0

推薦答案

在大多數情況下,這樣可以解決問題:

In most cases, this solves the problem:

conda install nomkl

這篇關于OMP:錯誤 #15:正在初始化 libiomp5.dylib,但發現 libiomp5.dylib 已初始化的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Troubles while parsing with python very large xml file(使用 python 解析非常大的 xml 文件時出現問題)
Find all nodes by attribute in XML using Python 2(使用 Python 2 在 XML 中按屬性查找所有節點)
Python - How to parse xml response and store a elements value in a variable?(Python - 如何解析 xml 響應并將元素值存儲在變量中?)
How to get XML tag value in Python(如何在 Python 中獲取 XML 標記值)
How to correctly parse utf-8 xml with ElementTree?(如何使用 ElementTree 正確解析 utf-8 xml?)
Parse XML from URL into python object(將 XML 從 URL 解析為 python 對象)
主站蜘蛛池模板: 煤棒机_增碳剂颗粒机_活性炭颗粒机_木炭粉成型机-巩义市老城振华机械厂 | 置顶式搅拌器-优莱博化学防爆冰箱-磁驱搅拌器-天津市布鲁克科技有限公司 | 楼梯定制_楼梯设计施工厂家_楼梯扶手安装制作-北京凌步楼梯 | 车辆定位管理系统_汽车GPS系统_车载北斗系统 - 朗致物联 | 仓储货架_南京货架_钢制托盘_仓储笼_隔离网_环球零件盒_诺力液压车_货架-南京一品仓储设备制造公司 | 铁盒_铁罐_马口铁盒_马口铁罐_铁盒生产厂家-广州博新制罐 | 活性氧化铝|无烟煤滤料|活性氧化铝厂家|锰砂滤料厂家-河南新泰净水材料有限公司 | 铝合金风口-玻璃钢轴流风机-玻璃钢屋顶风机-德州东润空调设备有限公司 | 工业车间焊接-整体|集中除尘设备-激光|等离子切割机配套除尘-粉尘烟尘净化治理厂家-山东美蓝环保科技有限公司 | 湖南档案密集架,智能,物证,移动,价格-湖南档案密集架厂家 | 权威废金属|废塑料|废纸|废铜|废钢价格|再生资源回收行情报价中心-中废网 | 不锈钢法兰-碳钢法兰-法兰盘生产加工厂家-[鼎捷峰]-不锈钢法兰-碳钢法兰-法兰盘生产加工厂家-[鼎捷峰] | 元拓建材集团官方网站 | 防火门|抗爆门|超大门|医疗门|隔声门-上海加汇门业生产厂家 | 南京泽朗生物科技有限公司-液体饮料代加工_果汁饮料代加工_固体饮料代加工 | 贝朗斯动力商城(BRCPOWER.COM) - 买叉车蓄电池上贝朗斯商城,价格更超值,品质有保障! | 电梯装饰-北京万达中意电梯装饰有限公司| 办公室家具_板式办公家具定制厂家-FMARTS福玛仕办公家具 | 深圳品牌设计公司-LOGO设计公司-VI设计公司-未壳创意 | 茶叶百科网-茶叶知识与茶文化探讨分享平台 | 河南包装袋厂家_河南真空袋批发价格_河南服装袋定制-恒源达包装制品 | 电子元器件呆滞料_元器件临期库存清仓尾料_尾料优选现货采购处理交易商城 | 百度爱采购运营研究社社群-店铺托管-爱采购代运营-良言多米网络公司 | 光伏家 - 太阳能光伏发电_分布式光伏发电_太阳能光伏网 | 压滤机滤板_厢式_隔膜_板框压滤机滤板厂家价格型号材质-大凯环保 | 安徽成考网-安徽成人高考网| 硅胶制品-硅橡胶制品-东莞硅胶制品厂家-广东帝博科技有限公司 | 专业甜品培训学校_广东糖水培训_奶茶培训_特色小吃培训_广州烘趣甜品培训机构 | 万博士范文网-您身边的范文参考网站Vanbs.com| 九州网址_专注于提供网址大全分享推广中文网站导航服务 | 吉林污水处理公司,长春工业污水处理设备,净水设备-长春易洁环保科技有限公司 | 江西自考网-江西自学考试网 | 美国HASKEL增压泵-伊莱科elettrotec流量开关-上海方未机械设备有限公司 | 岸电电源-60HZ变频电源-大功率变频电源-济南诚雅电子科技有限公司 | 冷凝锅炉_燃气锅炉_工业燃气锅炉改造厂家-北京科诺锅炉 | 北京森语科技有限公司-模型制作专家-展览展示-沙盘模型设计制作-多媒体模型软硬件开发-三维地理信息交互沙盘 | 山东锐智科电检测仪器有限公司_超声波测厚仪,涂层测厚仪,里氏硬度计,电火花检漏仪,地下管线探测仪 | 铝合金电阻-无源谐波滤波器-上海稳达电讯设备厂 | 迪威娱乐|迪威娱乐客服|18183620002 | 膜结构车棚|上海膜结构车棚|上海车棚厂家|上海膜结构公司 | 办公室家具_板式办公家具定制厂家-FMARTS福玛仕办公家具 |