You really need to add full error log for better helps, but my guess is, you executed script outside the script's path.
In short, you might have executed script INSIDE lenet_5 first, then on next runs you either did os.chdir or executed script OUTSIDE it, seemingly Python_ex
In terminal, the directory you are currently in terminal become current working directory for any script you run.
>>> import os
>>> os.listdir("./exported")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
FileNotFoundError: [WinError 3] 지정된 경로를 찾을 수 없습니다: './exported'
[WinError 3] 지정된 경로를 찾을 수 없습니다: './exported'
# current working directory is not where I intended
>>> os.getcwd()
'C:\\Users\\jupiterbjy'
# now change directory to where I want to be
>>> os.chdir("E:/Media/Works/CSP")
>>> os.listdir("./exported")
['banners', 'bg2.png', 'box.png', ...
>>> os.getcwd()
'E:\\Media\\Works\\CSP'
Old answer
Why not try out much superior alternative pathlib.Path?
if os.listdir is absolutely needed you can just convert it into string and feed the string-fied path into os.listdir.
>>> import pathlib
>>> root = pathlib.Path("./")
>>> root
WindowsPath('.')
>>> root.absolute().as_posix()
'E:/Media/Works/CSP/Exported'
>>> root.joinpath("banners").absolute()
WindowsPath('E:/Media/Works/CSP/Exported/banners')
>>> def images_gen():
... for path in root.iterdir():
... if path.suffix in (".png", ".jpg"):
... yield path
>>> import pprint
>>> images = list(images_gen())
>>> pprint.pprint(images)
[WindowsPath('bg2.png'),
WindowsPath('box.png'),
...
>>> data = images[0].read_bytes()
>>> len(data)
81245
# pathlib.Path features
>>> pprint.pprint([method for method in dir(root) if not method.startswith("_")])
['absolute',
'anchor',
'as_posix',
'as_uri',
'chmod',
'cwd',
'drive',
'exists',
'expanduser',
'glob',
'group',
'hardlink_to',
'home',
'is_absolute',
'is_block_device',
'is_char_device',
'is_dir',
'is_fifo',
'is_file',
'is_mount',
'is_relative_to',
'is_reserved',
'is_socket',
'is_symlink',
'iterdir',
'joinpath',
'lchmod',
'link_to',
'lstat',
'match',
'mkdir',
'name',
'open',
'owner',
'parent',
'parents',
'parts',
'read_bytes',
'read_text',
'readlink',
'relative_to',
'rename',
'replace',
'resolve',
'rglob',
'rmdir',
'root',
'samefile',
'stat',
'stem',
'suffix',
'suffixes',
'symlink_to',
'touch',
'unlink',
'with_name',
'with_stem',
'with_suffix',
'write_bytes',
'write_text']