我在windows 10上的jupyter笔记本中工作,试图运行以下程序:
ad = 'C:\\Users\\S m\\mbdataset\\trainmbds'
CAT = ['0 to 10','10 to 20','20 to 30','30 to 40','40 to 50']
for cat in CAT:
path = os.path.join(ad, cat)
for img in os.listdir(path):
img_array = cv2.imread(os.path.join(path,img))
plt.imshow(img_array)
plt.show
break
break
在上面的返回中,我得到以下错误:
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'C:\\Users\\S m\\mbdataset\\trainmbds\\0 to 10'
虽然0 to 10
的地址也是C:\Users\S m\mbdataset\trainmbds\0 to 10
,但我尝试用各种斜杠(/,\和\\)来写地址,它显示了相同的错误。
我遇到这个问题是因为我的文件路径地址中有太多的空格
目前没有回答
相关问题 更多 >
编程相关推荐