2022年12月9日

摘要: pymongo的client方法 连接mongo数据库后,执行命令后报错,OP_QUERY 不支持,客户端驱动需要升级,这就是说明执行mongodb命令的 pymongo版本太低,需要升级。 1、 File "/usr/local/python3/lib/python3.8/site-package 阅读全文
posted @ 2022-12-09 23:28 兵者 阅读(1363) 评论(0) 推荐(0) 编辑

2022年1月28日

摘要: 迁移Spark2.4.2/Scala 2.11 工程项目到Spark 3.0.3/Scala 2.12 的过程,运行工程代码报错: User class threw exception: java.lang.NoSuchMethodError: scala.Predef$.refArrayOps([ 阅读全文
posted @ 2022-01-28 18:15 兵者 阅读(2460) 评论(0) 推荐(0) 编辑

2021年12月8日

摘要: 大数据Spark任务中,分区数过小,每个分区的数据量会很大,执行join、crossjoin的过程,有可能导致shuffle write失败的操作。 可能原因包括: executor.memory内存不足,导致相应比例的nio资源不足, executor.memoryOverhead不足,没有足够的 阅读全文
posted @ 2021-12-08 18:19 兵者 阅读(708) 评论(0) 推荐(0) 编辑

2021年5月10日

摘要: 共同点,二者都是表示字符串的一种方式; 在python语法中,可以类似列表的下表进行访问、迭代器迭代,但是都不可以更改。 str -> bytes: bytes(str_instance, encoding='utf-8') str_instance.encode('utf-8') bytes -> 阅读全文
posted @ 2021-05-10 20:37 兵者 阅读(178) 评论(0) 推荐(0) 编辑

2021年2月24日

摘要: Tensorflow 的版本,已经从1.0 进展到2.0 安装比较旧的版本时,有可能发现再pypi镜像中不存在,并没有对应的版本,而是只有2.*; 报错信息可能: ERROR: Could not find a version that satisfies the requirement tenso 阅读全文
posted @ 2021-02-24 20:07 兵者 阅读(3675) 评论(1) 推荐(1) 编辑

2021年1月15日

摘要: 利用字符串的decode方法,如果不是对应字符编码,报异常,然后返回False 是否为ascii字符: def is_ascii(s): try: if s.decode('ascii'): return True except Exception as e: return False 是否为asc 阅读全文
posted @ 2021-01-15 14:55 兵者 阅读(1422) 评论(0) 推荐(0) 编辑

2020年12月31日

摘要: 除去Out of Memory这类的运行时报错,下述CUDA cublas error错误,也可能是内存不足导致的。CUBLAS_STATUS_NOT_INITIALIZED Error Message Summary: ExternalError: Cublas error, CUBLAS_STA 阅读全文
posted @ 2020-12-31 11:10 兵者 阅读(1369) 评论(0) 推荐(0) 编辑

2020年11月5日

摘要: Docker 镜像实例的退出,1、 在客户端执行快捷键 Ctrl+P+Q 2、exit / Ctrl+D Docker 实例查看 Docker ps, docker ps -l 阅读全文
posted @ 2020-11-05 10:19 兵者 阅读(86) 评论(0) 推荐(0) 编辑

2020年10月8日

摘要: 基本逻辑: 输入字符串,获取md5码,字符串形式获取末尾的两个16进制字符,然后使用int(xx,16)获取对应的[0,255]的值,取模index_size获得[0,index_size]对应的随机索引; Python2: 引入hashlib包: import hashlib 1 def get_ 阅读全文
posted @ 2020-10-08 21:05 兵者 阅读(1471) 评论(0) 推荐(0) 编辑

2020年7月10日

摘要: fastnumbers参考文档: https://fastnumbers.readthedocs.io, 除了提供fast_float,fast_real等函数来加速builtins API外,此包还提供了isreal, isfloat, isint, isintlike等API,方便调用判断输入是 阅读全文
posted @ 2020-07-10 14:04 兵者 阅读(1015) 评论(0) 推荐(0) 编辑

导航