NotADirectoryError: [WinError 267] 目录名称无效。: 'D:\\shuju\\train\\000001.png'
时间: 2023-08-29 09:09:39 浏览: 216
Selenium WebDriver测试 NotADirectoryError: [WinError 267] 目录名称无效。
NotADirectoryError: [WinError 267 目录名称无效。: 'D:\\shuju\\train\\000001.png' 这个错误是因为你在读取图片时,将文件路径设置成了具体到图片文件的位置,而不是文件所在的文件夹。解决办法是将路径设置为图片所在文件夹的路径即可,不需要具体到图片文件位置。 例如,将路径修改为 'D:\\shuju\\train' 就可以解决这个错误。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [NotADirectoryError: [WinError 267] 目录名称无效。: ‘123456.txt](https://blog.csdn.net/weixin_42942135/article/details/113904212)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [Selenium WebDriver测试 NotADirectoryError: [WinError 267] 目录名称无效。](https://download.csdn.net/download/weixin_38637884/13741116)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [NotADirectoryError: [WinError 267] 目录名称无效。: ‘img/train_1.png](https://blog.csdn.net/m0_52190506/article/details/121769862)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文