当前位置:网站首页>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.
边栏推荐
猜你喜欢
随机推荐
(转帖)hashcode和equals的关系
线性代数学习笔记3-2:矩阵乘法的理解
MySQL分区表详解
手把手带你 Unity 入门之从零创建一个时钟(GameObjects 与 Scripts)
STL entry basics map and set containers
[详解C语言]一文带你玩转C语言小游戏---扫雷
输入延迟切换系统的预测镇定控制
线性代数学习笔记2-1:向量和向量组、线性相关性(张成空间的概念)
5. Hezhou Air32F103_LCD_key
rem adaptation
mysql中json类型字段用法
Small program (necessary common sense for development) 1
A senior test engineer asked me these questions as soon as the interview came
mysql中exists的用法详解
RHCSA第三天
赶紧进来!!!教你用C语言写三子棋小游戏
第十一天&shell脚本
MySQL常见的索引
(转帖)HashCode总结(1)
LeetCode:第304场周赛【总结】

![CV-Model [4]: MobileNet v3](/img/a1/fc3901d55b28aa080235f093b94cb4.png)







