FILENOTFOUNDERROR:[ERRNO 2]没有这样的文件或目录:'数据集/flower/flower_photos'

发布于 2025-01-28 23:06:53 字数 619 浏览 4 评论 0 原文

我遵循练习9.1上的代码,,这是代码:

flowers_root_path = os.path.join(FLOWERS_PATH, "flower_photos")
flower_classes = sorted([dirname for dirname in os.listdir(flowers_root_path)
              if os.path.isdir(os.path.join(flowers_root_path, dirname))])
flower_classes

但是我有错误: fil> filnotfounderror:[errno 2]没有此类文件或目录:花/flower_photos' 有人知道如何解决这个问题吗,谢谢

I follow the code on exercise 9.1 at https://notebook.community/me-surrey/dl-gym/.ipynb_checkpoints/13_convolutional_neural_networks-checkpoint, and here is the code:

flowers_root_path = os.path.join(FLOWERS_PATH, "flower_photos")
flower_classes = sorted([dirname for dirname in os.listdir(flowers_root_path)
              if os.path.isdir(os.path.join(flowers_root_path, dirname))])
flower_classes

but I got the error:FileNotFoundError: [Errno 2] No such file or directory: 'datasets/flowers/flower_photos'
Does any one know how to fix this, thank you

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

情感失落者 2025-02-04 23:06:53

您确定目录是否存在?
查看目录是否真的存在
这本来可以是评论,但我没有足够的代表评论

希望这会有所帮助:)

Are you sure the directory exists ?
See if the directory actually exists
This could have been a comment but I dont have enough rep to comment

Hope this helps :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文