自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(12)
  • 资源 (1)
  • 收藏
  • 关注

原创 最详细的python装饰器详解

先直接看例子def play1(fn): def inner(x, y, *args, **kwargs): print(args[0]) print(kwargs.get('name')) b = fn(x, y) print('b: ' + str(b)) print('99999') return b return innerdef play2(f1): def inn.

2020-08-28 17:19:56 219

原创 python3进程池pool使用及注意事项

1.在python中使用进程池主要就是为了并行处理任务,缩短运行时间2.经常使用方法: 同步有 apply(), map();异步的有 apply_async(), map_async()3. 先看几个小例子import time from multiprocessing import Pool test = [1,2,3,4,5,6,7,8]def run(fn): ti...

2019-09-24 17:25:00 1742 1

原创 python3.6.5基于kerberos认证的hdfs,hive连接调用(含基础环境配置)

1需要准备的环境yum包(需要先装yum包,再装python包,不然会有问题) yum install openldap-clients -y yum install krb5-workstation krb5-libs -y yum install gcc-c++ python-devel.x86_64 cyrus-sasl-devel.x86_64 yum...

2019-09-10 17:11:34 3775 6

原创 python3.6.5 centos快速安装

#!/bin/bashyum groupinstall 'Development Tools'yum install zlib-devel bzip2-devel openssl-devel ncurses-develwget --no-check-certificate https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tgz...

2019-07-02 17:51:27 197

原创 python3.6.5基于kerberos认证的hive和hdfs连接调用

1.Kerberos是一种计算机网络授权协议,用来在非安全网络中,对个人通信以安全的手段进行身份认证。具体请查阅官网2. 需要安装的包(基于centos)yum install libsasl2-devyum install gcc-c++ python-devel.x86_64 cyrus-sasl-devel.x86_64yum install python-devel ...

2019-07-02 17:45:56 6687 10

原创 AttributeError: 'module' object has no attribute 'lru_cache'

报错如下:Connected to pydev debugger (build 172.4343.24)Traceback (most recent call last):  File "D:\soft\pycharm\PyCharm 2017.2.4\helpers\pydev\pydevd.py", line 1599, in <module>    globals = ...

2018-07-24 22:09:50 4968

原创 class 'tensorflow.python.framework.errors_impl.UnavailableError, OS Error

具体报错如下:2018-07-24 16:28:43.875720: E tensorflow/core/distributed_runtime/master.cc:269] Master init: Unavailable: OS ErrorINFO:tensorflow:Error reported to Coordinator: <class 'tensorflow.python...

2018-07-24 17:43:48 3131 1

原创 truncated record at 132658019

具体报错如下:INFO:tensorflow:Error reported to Coordinator: <class 'tensorflow.python.framework.errors_impl.DataLossError'>, truncated record at 132658019     [[Node: parallel_read/ReaderReadV2_2 =...

2018-07-24 11:01:29 3323 2

原创 tensorflow分布式情况下,ps负载不均衡

       先说下问题背景,在tensorflow官方支持的分布式中,即ps,worker模式中,由于模型变量的因素,导致变量在ps上初始化的时候负载不均衡,到时影响训练性能,最近就遇到这种问题,测的是inception_v3这个模型,在分布式中,看各个ps所在机器cup利用率和网络带宽差异很大,然后就做了ps上变量的负载均衡,负载均衡后,性能提升大约在10%~20%左右,具体不多说,直接上代码...

2018-07-23 14:39:12 2935

原创 assertion failed: [Unable to decode bytes as JPEG, PNG, GIF, or BMP

具体报错如下:INFO:tensorflow:Error reported to Coordinator: <class 'tensorflow.python.framework.errors_impl.InvalidArgumentError'>, assertion failed: [Unable to decode bytes as JPEG, PNG, GIF, or BM...

2018-07-23 14:16:21 4788 10

原创 生成tfrecod类型数据集

        最近在做tensorflow分布式训练时,遇到一个问题,就是在分布式文件系统中,tensorflow读取jpeg数据很慢,因为有十几万的图片,导致要读半个小时以上,所以想提高数据读取速度,就把jpeg数据转换成tfrecord类型数据。我已celeba数据为例,二十多万张图片,转换成tfrecord类型的数据后,读取这些数据只要30秒左右。        其实在tensorflow...

2018-04-07 20:54:31 660

原创 Could not satisfy explicit device specification '/job:worker/task:0/device:GPU:1' because no support

如上图报错,说gpu没有支持的kernel。原因是应为在tensorflow中,定义在图中的op,有的只能再cup中运行,gpu中不支持。解决方法就是让op自动识别,让它选择在合适的地方运行即可。如果op中有标识的话,在运行的时候指定在cup上执行,如果无法区分的话,可以试试在sess.run的时候加入allow_soft_placement=True。例如:sess = tf.Session(c...

2017-12-12 19:38:47 4105

深度学习梯度压缩

梯度压缩,1bit量化。

2018-12-27

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除