首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法打开带有空白“我的硬盘”的train.txt

无法打开带有空白“我的硬盘”的train.txt
EN

Stack Overflow用户
提问于 2019-06-18 09:04:56
回答 2查看 1.8K关注 0票数 0

我正在尝试在yolov3中自定义数据集。我正在使用google colab和google drive来存储数据和配置文件。

文件内容如下:

代码语言:javascript
复制
classes= 1  
train  = /content/gdrive/My 
Drive/mrcnn_fire/yolo_files/yolo_first_example/data/nfpa/train.txt  
valid  = /content/gdrive/My Drive/mrcnn_fire/yolo_files/yolo_first_example/data/nfpa/test.txt  
names = /content/gdrive/My Drive/mrcnn_fire/yolo_files/yolo_first_example/obj.names  
backup = /content/gdrive/My Drive/mrcnn_fire/yolo_files/yolo_first_example/backup/

当我运行以下命令时:

代码语言:javascript
复制
!./darknet detector train /content/gdrive/My\ Drive/mrcnn_fire/yolo_files/yolo_first_example/obj.data cfg/yolov3.cfg yolov3.weights

我得到以下错误:

代码语言:javascript
复制
Couldn't open file: /content/gdrive/MyDrive/mrcnn_fire/yolo_files/yolo_first_example/data/nfpa/train.txt

我认为这与空格解析有关。我能解决这个问题吗?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2019-11-19 15:21:47

在配置文件中配置路径时,您必须小心。obj.data文件的路径上需要有用转义的空格。像这样:/content/gdrive/My\ Drive/darknet/train.txt。但是,您在文件train.txt和test.txt中定义的路径没有正确转义!

链接:https://colab.research.google.com/drive/1lTGZsfMaGUpBG4inDIQwIJVW476ibXk_#scrollTo=wkzMqLZV-rF5

票数 1
EN

Stack Overflow用户

发布于 2020-01-15 22:51:59

尝试使用!ln -s "/content/gdrive/My Drive/darknet" /darknet简化路径

并改用/darknet

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56640534

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档