h = imread.shape[0] AttributeError: 'NoneType' object has no attribute 'shape'
时间: 2023-10-04 09:14:16 浏览: 109
根据引用和引用的内容,这个错误是由于变量imread为NoneType而导致的,而NoneType没有shape属性。这种错误通常发生在我们认为我们在使用特定类或对象的实例时。在这种情况下,imread可能没有被正确地赋值。要解决这个错误,你需要检查你的代码并确保你正确地给变量imread赋值,以确保它是一个有shape属性的对象。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [cv2问题:AttributeError: ‘NoneType‘ object has no attribute ‘shape‘及CV2显示、保存图片](https://blog.csdn.net/qq_38230414/article/details/127045473)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *3* [OpenCV:解决NoneType错误](https://download.csdn.net/download/weixin_38703968/13749618)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文