Traceback (most recent call last): File "C:/Users/asus/Desktop/UI界面/YoloV5_PyQt5-main(原版)/detect_logical.py", line 168, in button_image_open info_show = self.detect(name_list, img) File "C:/Users/asus/Desktop/UI界面/YoloV5_PyQt5-main(原版)/detect_logical.py", line 124, in detect img = letterbox(img, new_shape=self.opt.img_size)[0] File "C:\Users\asus\Desktop\UI界面\YoloV5_PyQt5-main(原版)\utils\datasets.py", line 820, in letterbox shape = img.shape[:2] # current shape [height, width] AttributeError: 'NoneType' object has no attribute 'shape'
时间: 2024-04-03 09:36:03 浏览: 31
根据错误提示,您的代码在使用函数 letterbox() 时出现了问题。具体来说,img 变量的值为 NoneType,因此无法访问其 shape 属性。请检查您的代码,并确保正确传递了 img 变量。此外,也要确保 img 变量是正确的类型和格式。如果问题仍然存在,请提供更多上下文和代码细节以便更好地帮助您解决问题。
相关问题
Traceback ( most recent call last ) :File " C:/python/kfc.py " , line 8
Traceback (most recent call last): File "C:/python/kfc.py", line 8
这是Python中的错误追踪信息,通常在程序出现错误时会显示。它告诉我们在哪个文件的哪一行出现了错误。
具体来说,"Traceback (most recent call last)" 表示错误追踪的开始,它告诉我们下面的信息是最近一次调用的错误。
"File "C:/python/kfc.py", line 8" 表示错误发生在文件 "C:/python/kfc.py" 的第8行。
如果你想解决这个错误,可以打开 "C:/python/kfc.py" 文件,并检查第8行的代码,看看是否有语法错误或逻辑错误。
[ WARN:0@38.138] global D:\a\opencv-python\opencv-python\opencv\modules\imgcodecs\src\loadsave.cpp (239) cv::findDecoder imread_('C:/Users/asus/Desktop/UI界面/YoloV5_PyQt5-main(原版)/data/images/bus.jpg'): can't open/read file: check file path/integrity Traceback (most recent call last): File "C:/Users/asus/Desktop/UI界面/YoloV5_PyQt5-main(原版)/detect_logical.py", line 168, in button_image_open info_show = self.detect(name_list, img) File "C:/Users/asus/Desktop/UI界面/YoloV5_PyQt5-main(原版)/detect_logical.py", line 124, in detect img = letterbox(img, new_shape=self.opt.img_size)[0] File "C:\Users\asus\Desktop\UI界面\YoloV5_PyQt5-main(原版)\utils\datasets.py", line 820, in letterbox shape = img.shape[:2] # current shape [height, width] AttributeError: 'NoneType' object has no attribute 'shape' img_name: C:/Users/asus/Desktop/UI界面/YoloV5_PyQt5-main(原版)/data/images/bus.jpg python-BaseException 进程已结束,退出代码-805306369 (0xCFFFFFFF)
根据错误提示,您的程序在读取文件 "C:/Users/asus/Desktop/UI界面/YoloV5_PyQt5-main(原版)/data/images/bus.jpg" 时出现了问题。请确保文件路径正确,并检查文件是否存在。此外,还要检查文件的格式是否正确。如果问题仍然存在,请检查您的代码并确保没有其他地方出现了问题。
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)