Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/280.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中数据集的URL_Python_Jupyter Notebook_Google Colaboratory - Fatal编程技术网

Python中数据集的URL

Python中数据集的URL,python,jupyter-notebook,google-colaboratory,Python,Jupyter Notebook,Google Colaboratory,与Python一起使用Colab或Jupyter笔记本。尝试使用URL链接到所需的数据集。当我打开labelFile时,CSV文件会下载,这样URL链接就可以工作了 path = os.system("start \"\" http://decadeofdata.com/datasets/TurnSignDetection/myData") labelFile = os.system("start \"\" http://d

与Python一起使用Colab或Jupyter笔记本。尝试使用URL链接到所需的数据集。当我打开labelFile时,CSV文件会下载,这样URL链接就可以工作了

path = os.system("start \"\" http://decadeofdata.com/datasets/TurnSignDetection/myData") 
labelFile = os.system("start \"\" http://decadeofdata.com/datasets/TurnSignDetection/labels.csv") 
这个错误表明我的方法不起作用

for x in range (0,noOfClasses):
myPicList = os.listdir(path+"/"+str(count))
for y in myPicList:
    curImg = cv2.imread(path+"/"+str(count)+"/"+y)
    images.append(curImg)
    classNo.append(count)
print(count, end =" ")
count +=1
TypeError:不支持+:“int”和“str”的操作数类型

有什么建议吗?我无法在本地计算机上将其作为py文件运行

链接到Colab。

我认为问题可能在这里:

path = os.system("start \"\" http://decadeofdata.com/datasets/TurnSignDetection/myData")
如果您执行
键入(路径)
打印(路径)
操作,我认为您将得到os.system的返回码,返回码将为0或1,具体取决于操作是否成功,这反过来会导致此处的添加:

 myPicList = os.listdir(path+"/"+str(count))
由于将0或1添加到
'/'
失败而失败

如果你转向下载而不是使用
os.system

_URL = "http://decadeofdata.com/datasets/TurnSignDetection/myData.zip"

zip_file = tf.keras.utils.get_file(origin=_URL,
                                   fname="myData.zip",
                                   extract=True)

path = os.path.join(os.path.dirname(zip_file), 'myData')

print(path)

_URL = "http://decadeofdata.com/datasets/TurnSignDetection/labels.csv"

label_file = tf.keras.utils.get_file(origin=_URL,
                                   fname="labels.csv",)

labelFile = os.path.join(os.path.dirname(label_file), 'labels.csv')
到目前为止,这是有效的,现在我正努力让皮克开始工作