In your bash_profile you lack of something. add export LANG="en_US.UTF-8" export LC_COLLATE="en_US.UTF-8" export LC_CTYPE="en_US.UTF-8" export LC_MESSAGES="en_US.UTF-8" export LC_MONETARY="en_US.UTF-8" exp…
执行Python出现LookupError: unknown encoding: cp65001错误 dos下执行以下命令即可 chcp 以上.…
原文:Python标准库09 当前进程信息 (部分os包) 作者:Vamei 出处:http://www.cnblogs.com/vamei 欢迎转载,也请保留这段声明.谢谢! 我们在Linux的概念与体系,多次提及进程的重要性.Python的os包中有查询和修改进程信息的函数.学习Python的这些工具也有助于理解Linux体系. 进程信息 os包中相关函数如下: uname() 返回操作系统相关信息.类似于Linux上的uname命令. umask() 设置该进程创建文件时的权限mask.类…
爬虫代理IP由芝麻HTTP服务供应商提供今天在写爬虫程序的时候由于要翻页,做除法分页的时候出现了 totalCount = ' totalPage = int(totalCount)/20 ValueError: invalid literal for int() with base 10的错误 网上同样的错误有人建议用round(float("1.0")),但是解决不了我这个问题,round(float("1.0"))是用于解决浮点数转换为整形数的, 而我这个则是…
int()函数只能转化数字组成的字符串,看例子: >>> a=' >>> int(a) 123 >>> b='abc' >>> int(b) Traceback (most recent call last): File "<stdin>", line 1, in <module> ValueError: invalid literal for int() with base 10: 'ab…
Solution: from keras.utils.generic_utils import CustomObjectScope with CustomObjectScope({'relu6': keras.applications.mobilenet.relu6,'DepthwiseConv2D': keras.applications.mobilenet.DepthwiseConv2D}): model = load_model('model_saved.hdf5') 官方github相关…
参考 https://groups.google.com/forum/#!topic/theano-users/tY3fNAPYd9k 这个问题是由于outs的数量没有设置对. 里面写到 “except that you should specify "n_out=6", because there are 6 different target classes (numbered from 0 to 5 inclusively). ” 也就是说n_out设置为6的话,Test_Y中的l…
天朝网络锁国,百度找了半个小时找不出来原因,只能谷歌 谷歌第一条就是,顿时感觉幸福感来的太突然 原因是输入的矩阵均是字符串(从文件里读的) 那么就需要批量转数组,一行一行的转. 下面是我的代码: rownum = 0 f = open(train_Y_path) for line in f.readlines(): train_Y_matrix[rownum] = map(float,line.strip('\n ').split(' ')) rownum += 1 print train_Y_…
说明:SVM训练的标签列必须为整型数值,不能为float.y = np.array(y, dtype=int)或y.astype('int')…
一. logging(日志模块) 二 .re模块 三. 时间模块 四. random模块 五. os模块 六. sys模块 七. shutil模块 八. 序列化模块(json&pickle&shelve) 九. XML模块 十.  configparser模块 十一 hashlib模块 一. logging(日志模块) 1.1 日志级别 CRITICAL = 50 #FATAL ERROR = 40 WARNING = 30 #WARN INFO = 20 DEBUG = 10 NOTSE…