KNN报错AttributeError: 'Flags' object has no attribute 'c_contiguous'
时间: 2023-10-09 16:04:52 浏览: 1150
knn.rar_c语言实现knn_knn iris_knn算法c语言_鸢尾花
KNN报错AttributeError: 'Flags' object has no attribute 'c_contiguous'的问题可能是由于使用的python版本不同导致的。引用中提到,在Python3的编译器中,不再使用iteritems()函数,而是使用items()函数。这可能会导致在KNN算法中出现错误。你可以尝试将使用iteritems()的代码改为items(),看看是否能够解决这个问题。
此外,根据你的问题描述,我没有找到与KNN报错相关的具体代码或具体原因。如果你能提供更多的代码或错误信息,我可以帮助你更准确地定位和解决这个问题。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [模型训练报错AttributeError: ‘NoneType‘ object has no attribute ‘text](https://blog.csdn.net/u014479551/article/details/107377992)[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_1"}}] [.reference_item style="max-width: 50%"]
- *2* [机器学习实战第二章kNN报错:AttributeError: ‘dict‘ object has no attribute ‘iteritems](https://blog.csdn.net/weixin_45252975/article/details/120683297)[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_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文