Python 我在运行这部分代码时出错。尝试了一些现有的解决方案,但没有一个有效 对于面位置中的面位置: 上、右、下、左=面位置 打印(“面位于像素位置顶部:{},右侧:{},左侧:{},底部:{}。”) ****我总是会遇到这样的错误:**** 文件“”,第1行 对于面位置中的面位置:

Python 我在运行这部分代码时出错。尝试了一些现有的解决方案,但没有一个有效 对于面位置中的面位置: 上、右、下、左=面位置 打印(“面位于像素位置顶部:{},右侧:{},左侧:{},底部:{}。”) ****我总是会遇到这样的错误:**** 文件“”,第1行 对于面位置中的面位置:,python,image-recognition,Python,Image Recognition,^SyntaxError:解析时出现意外的EOF可能是因为您忘记在for循环后使用选项卡? 而不是 for face_location in face_locations: top , right, bottom , left = face_location print("A face is located at the pixel locations Top: {} , Right:{} , Left: {} , Bottom: {}.") **** I always get this

^SyntaxError:解析时出现意外的EOF

可能是因为您忘记在for循环后使用选项卡? 而不是

for face_location in face_locations:
top , right, bottom , left = face_location
print("A face is located at the pixel locations Top: {} , Right:{} , Left: {} , Bottom: {}.")

   **** I always get this error:****

 File "<ipython-input-55-23558b69803e>", line 1
for face_location in face_locations:


当出现任何错误时,实际的错误通常是上一行或下一行
for face_location in face_locations:
top , right, bottom , left = face_location
for face_location in face_locations:
    top , right, bottom , left = face_location