今天训练代码结果一直报错,提示
OMP: Error #15: Initializing libiomp5md.dll, but found libiomp5md.dll 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/.
翻译出来是
OMP:错误#15:初始化libiomp5md.dll,但发现libiomp5md.dll已经初始化。 OMP:提示这意味着OpenMP运行时的多个副本已经链接到程序中。这是危险的,因为它会降低性能或导致不正确的结果。最好的做法是确保只有一个OpenMP运行时链接到进程中,例如避免在任何库中静态链接OpenMP运行时。作为一种不安全、不受支持、无文档记录的解决方案,您可以设置环境变量KMP_DUPLICATE_LIB_OK=TRUE,以允许程序继续执行,但这可能会导致崩溃或悄悄地产生不正确的结果。欲了解更多信息,请参见http://www.intel.com/software/products/support/。
然后就找博客,然后看到很多解决都是说删掉libiomp5md.dll,然后我就删掉了"E:Anacondaenvspytorch1Libsite-packagestorchlib"下面的,结果还是报这个错,我就有还回去了,后来我看到了https://blog.csdn.net/weixin_43823786/article/details/124525625这篇博客,然后我以为他让我删掉"E:AnacondaLibrarybinlibiomp5md.dll"我就删了,结果还是报错。
最后最后,终于,我舍得去搜索框搜了libiomp5md.dll*,发现我的"E:Anacondaenvspytorch1Librarybinlibiomp5md.dll"这里还有一个,我一下就知道我可能会错意了,我应该删掉我创建的虚拟环境下的多余的libiomp5md.dll。
不过还好,终归是解决了。虽然还是迷糊,不过希望可以帮助到和我一样迷糊的同学。



