Wiz*_*ipe 3 python import artificial-intelligence dataset jupyter-notebook
当我尝试导入此代码的开头时,我遇到此错误:
ImportError: 导入 _imaging 时 DLL 加载失败: 找不到指定的模块。
我的代码是:
# Basic Imports
import numpy as np
import matplotlib.pyplot as plt
from glob import glob
from PIL import Image
# Imports for Building CNN
from keras.layers import Input, Lambda, Dense, Flatten
from keras.models import Model
from keras.applications.vgg16 import VGG16
from keras.applications.vgg16 import preprocess_input
from keras.preprocessing import image
from keras.preprocessing.image import ImageDataGenerator
from keras.models import Sequential, load_model
from tensorflow.keras.preprocessing.image import load_img
# Ignore Warnings
import warnings
warnings.filterwarnings("ignore")
Run Code Online (Sandbox Code Playgroud)
错误(来自 jupyter 笔记本)显示为:
``
ImportError Traceback (最近一次调用最后) 输入 In [5], in <cell line: 3>() 1 # 基本导入 2 import numpy as np 3 import matplotlib.pyplot as plt 4 from glob import glob 5 from PIL import Image
文件 D:\Black\miniconda3\envs\tensorflow\lib\site-packages\matplotlib_ init _.py:109, in 105 from parking.version import parse as parse_version 107 # cbook 必须仅在函数 108 # 定义内导入 matplotlib,所以从这里导入是安全的。109 从 . import _api, _version, cbook, docstring, rcsetup 110 from matplotlib.cbook import MatplotlibDeprecationWarning, sanitize_sequence 111 from matplotlib.cbook import mplDeprecation # 已弃用
文件 D:\Black\miniconda3\envs\tensorflow\lib\site-packages\matplotlib\rcsetup.py:27,在 25 from matplotlib import _api, cbook 26 from matplotlib.cbook import ls_mapper 27 from matplotlib.colors import Colormap, is_color_like 28 从 matplotlib.fontconfig_pattern 导入 parse_fontconfig_pattern 29 从 matplotlib._enums 导入 JoinStyle, CapStyle
File D:\Black\miniconda3\envs\tensorflow\lib\site-packages\matplotlib\colors.py:51, in 49 from numbers import Number 50 import re 51 from PIL import Image 52 from PIL.PngImagePlugin import PngInfo 54 import matplotlib as mpl
File D:\Black\miniconda3\envs\tensorflow\lib\site-packages\PIL\Image.py:100, in 91 MAX_IMAGE_PIXELS = int(1024 * 1024 * 1024 // 4 // 3) 94 try: 95 # If the _imaging C module is not present, Pillow will not load. 96 # Note that other modules should not refer to _imaging directly; 97 # import Image and use the Image.core variable instead. 98 # Also note that Image.core is not a publicly documented interface, 99 # and should be considered private and subject to change. 100 from . import _imaging as core 102 if version != getattr(core, "PILLOW_VERSION", None): 103 raise ImportError( 104 "The _imaging extension was built for another version of Pillow or PIL:\n" 105 f"Core version: {getattr(core, 'PILLOW_VERSION', None)}\n" 106 f"Pillow version: {version}" 107 )
ImportError: DLL load failed while importing _imaging: The specified module could not be found. ``
I think something is outdated? if that is the case, what can I do to solve this issue?
| 归档时间: |
|
| 查看次数: |
2842 次 |
| 最近记录: |