Month: February 2022

安装pandas

pandas对numpy版本要求比较高,需要先升级numpy再安装pandas,命令行如下: 1.python2 pip install –upgrade numpy pip install pandas 2.python3 pip3 install –upgrade numpy pip3 install pandas

pandas读取csv常见错误及解决方法

1) 错误提示:pandas.errors.ParserError: Error tokenizing data. C error: Expected 1 fields in line 121, saw 2 解决方法: import pandas as pd data = pd.read_csv(inputfile, encoding=’utf-8′,header=None,sep = ‘t’) 2) 错误提示:pandas.errors.ParserError: Error tokenizing data. C error: EOF inside string starting at line 15945 解决方法: import pandas as pd import csv df = pd.read_csv(csvfile, quoting=csv.QUOTE_NONE, encoding=’utf-8′) 参考链接:https://stackoverflow.com/questions/18016037/pandas-parsererror-eof-character-when-reading-multiple-csv-files-to-hdf5

TypeError: ‘_IncompatibleKeys’ object is not callable

在使用pytorch编写代码时,出现了”TypeError: ‘_IncompatibleKeys’ object is not callable”,报错原因如下: model = model.load_state_dict(torch.load('model.pt')) model.load_state_dict(torch.load(‘model.pt’))返回结果不是model类型,正确写法是: model.load_state_dict(torch.load(PATH)) 调用model.load_state_dict之后即可加载成功,不用单独再赋变量。

SIFT学习资料收集

https://github.com/aishack/sift http://aishack.in/tutorials/implementing-sift-opencv/ https://marcosnietoblog.wordpress.com/2012/07/15/source-code-for-sift-orb-fast-and-ffme-for-opencv-c-for-egomotion-estimation/ 【OpenCV】SIFT原理与源码分析 – 小魏的修行路 – 博客频道 – CSDN.NET http://blog.csdn.net/xiaowei_cqu/article/details/8069548 OpenCV2.4.4中调用SIFT特征检测器进行图像匹配 – Why So Serious? – 博客频道 – CSDN.NET http://blog.csdn.net/masibuaa/article/details/8998601 RobHess的SIFT源码分析:综述 – Why So Serious? – 博客频道 – CSDN.NET http://blog.csdn.net/masibuaa/article/details/9191309