当前位置:网站首页>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.
边栏推荐
猜你喜欢
LeetCode:第304场周赛【总结】
磷脂-聚乙二醇-靶向新生血管靶向肽APRPG,DSPE-PEG-APRPG
JSP WebSehll backdoor script
LeetCode:1161. 最大层内元素和【BFS层序遍历】
AttributeError: ‘Upsample‘ object has no attribute ‘recompute_scale_factor‘
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
PowerManagerService灭屏超时流程
LeetCode:1374. 生成每种字符都是奇数个的字符串【签到题】
UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the index ing argu
「PHP基础知识」PHP中对象的使用
随机推荐
小程序组件总结
Day34 LeetCode
第七周复习
DOM destruction and reproduction experiment
构造方法、方法重载、全局变量与局部变量
考虑饱和的多智能体系统数据驱动双向一致性
磷脂-聚乙二醇-靶向新生血管靶向肽APRPG,DSPE-PEG-APRPG
JSP WebSehll backdoor script
Week 7 Review
MySQL删除表数据 MySQL清空表命令 3种方法
科研试剂DMPE-PEG-Mal 二肉豆蔻酰磷脂酰乙醇胺-聚乙二醇-马来酰亚胺
分布式领域最重要的一篇论文,到底讲了什么?
rem adaptation
基于libmodbus库实现modbus TCP/RTU通信
TRICK second bullet
day11--shell脚本
CV-Model【4】:MobileNet v3
关于跨域问题
PCL—点云数据分割
[详解C语言]一文带你玩转C语言小游戏---扫雷