当前位置:网站首页>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.
边栏推荐
猜你喜欢
随机推荐
线性代数学习笔记3-3:逆矩阵的理解
线性代数学习笔记3-2:矩阵乘法的理解
支付通道对接常见的问题有哪些?
黑马案例--实现 clock 时钟的web服务器
线性代数学习笔记2-2:向量空间、子空间、最大无关组、基、秩与空间维数
Redis的集群模式
@Accessors 注解详解
磷脂-聚乙二醇-酰肼,DSPE-PEG-Hydrazide,DSPE-PEG-HZ,MW:5000
多个el-select下拉框无法选中相同内容
构造方法、方法重载、全局变量与局部变量
DSPE-PEG-Silane,DSPE-PEG-SIL,磷脂-聚乙二醇-硅烷修饰活性基团
线性代数学习笔记1:何为线性代数
Double Strings (don't always forget substr)
(转帖)hashcode和equals的关系
Monaco Editor 的基本用法
第七周复习
OD-Model【4】:SSD
5.nodejs--跨域、CORS、JSONP 、Proxy
化学试剂磷脂-聚乙二醇-羟基,DSPE-PEG-OH,DSPE-PEG-Hydroxyl,MW:5000
MySQL分组后取最大一条数据【最优解】









