关于在Jupyter notebook里 同时import tensorflow和torch报错的问题

问题:在jupyter里import torch时报错

import tensorflow as tf
import torch

出现报错信息:

OSError: [WinError 182] 操作系统无法运行 %1。 Error loading "D:SoftwareAnacondaenvsDLearninglibsite-packagestorchlibshm.dll" or one of its dependencies.

单独import torch时却没有报错,在spyder里import也没有报错,十分奇怪的一个问题。

解决方法:

更改import的顺序

import torch
import tensorflow as tf

或取消import tensorflow

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
THE END
分享
二维码
< <上一篇
下一篇>>