Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/58.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 无法用空格“打开train.txt”;“我的驾驶”;他_Python_C_Google Colaboratory_Yolo - Fatal编程技术网

Python 无法用空格“打开train.txt”;“我的驾驶”;他

Python 无法用空格“打开train.txt”;“我的驾驶”;他,python,c,google-colaboratory,yolo,Python,C,Google Colaboratory,Yolo,我正在尝试在yolov3中自定义数据集。 我正在使用GoogleColab和GoogleDrive来存储数据和配置文件 这是文件内容: 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_exam

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

这是文件内容:

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/
当我运行以下命令时:

!./darknet detector train /content/gdrive/My\ Drive/mrcnn_fire/yolo_files/yolo_first_example/obj.data cfg/yolov3.cfg yolov3.weights
我得到以下错误:

Couldn't open file: /content/gdrive/MyDrive/mrcnn_fire/yolo_files/yolo_first_example/data/nfpa/train.txt
我认为这与空白解析有关。
我能解决这个问题吗?

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

链接:

尝试使用简单路径
!ln-s“/content/gdrive/My Drive/darknet”/darknet

并使用/darknet代替