目录
1.首先是报错内容:
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/.
2.先来一个治标不治本的解决方式:
import os
os.environ['KMP_DUPLICATE_LIB_OK']='True'
直接输入上述代码: 他的作用就是无视出现的问题继续运行程序,虽然看起来有点像c语言 解决scanf 警报的问题, 但二者的本质大相径庭 这个问题其实很大 是因为 你的 环境里出现了两个或多个libiomp5md.dll 文件, 在跑程序的时候你的程序中链接了多个OpenMP运行时库,导致冲突和不稳定, 也就是说你的电脑不知道使用这两个哪个比较好。
3.接下来是彻底解决这个问题的一个可选的方法:
其实也很简单两个的话删掉一个或者,给另一个重命名就行了
首先就是要找到你这个文件在哪
右下角找你的环境 当前解释器为: 不啦不啦一大串
然后在你的资源管理器(文件夹) 里打开这一串
在搜索栏里面查找 libiomp5md.dll 即可
下一步很重要 如图 不要碰torch 库里面的那个 ,把环境里面多出来那个 重命名就好了,
因为环境里面的那个是如果你anaconda 下载的时候自带的,只留torch 库里面那个就够了,当然保险起见,就重命名一下得了,才不到2mb 万一删了以后又出现问题咋整