当前位置:网站首页>Error: with open(txt_path,'r') as f: FileNotFoundError: [Errno 2] No such file or directory:
Error: with open(txt_path,'r') as f: FileNotFoundError: [Errno 2] No such file or directory:
2022-08-02 03:33:00 【woshicaiji12138】
When doing deep learning today, the following error occurred:
root='G:/anaconda/pythonProject2/DATA/HWDB1'transform = transforms.Compose([transforms.Resize((64,64)),transforms.ToTensor(),transforms.Grayscale()])# read training settrain_dataset =Mydataset(root+'/train.txt',num_class=10,transforms=transform)with open(txt_path,'r') as f: FileNotFoundError: [Errno 2] No such file or directory: 'G:\anaconda\pythonProject2\HWDB1/train.txt'
The reason is that trainThe contents of the .txt file format are as follows: ./DATA/HWDB1/train\00000\100234.png.
The file name of the HWDB1 dataset is HWDB1, so the absolute path becomes G:/anaconda/pythonProject2/HWDB1/HWDB1, which naturally cannot be found.
So just rename the folder HWDB1 to DATA and make the path name G:\anaconda\pythonProject2\DATA\HWDB1.
边栏推荐
猜你喜欢
随机推荐
sh: 1: curl: not found
Double Strings (别总忘记substr)
Freeswitch操作基本配置
线性代数学习笔记3-2:矩阵乘法的理解
Redis笔记基础篇:6分钟看完Redis的八种数据类型
CV-Model [4]: MobileNet v3
Daily practice------There are n integers, so that the previous numbers are moved back m positions in order, and the last m numbers become the first m numbers
Keil开发环境安装教程
线性代数学习笔记3-1:矩阵与线性变换、常见矩阵(逆矩阵、伴随矩阵、正交矩阵等)
连接数据库时遇到的bug1号
小程序组件总结
MongoDB文档存储
3分钟带你了解微信小程序开发
我的两周年创作纪念日
Day34 LeetCode
分布式领域最重要的一篇论文,到底讲了什么?
MySQL中的各种锁(行锁、间隙锁、临键锁等等LBCC)
MySQL中JOIN的用法
黑马案例--实现 clock 时钟的web服务器
考虑饱和的多智能体系统数据驱动双向一致性









