
纯记录
文章平均质量分 55
Ben出没冇注意
这个作者很懒,什么都没留下…
展开
-
利用Tensorlfow model optimization tool进行网络剪枝遇到不支持的层
问题描述:使用TensorFlow Model Optimization 0.6.0对自己的网络进行剪枝的时候,遇到官方暂时不支持的层ValueError: Please initialize with a supported layer. Layers should either be supported by the PruneRegistry (built-in keras layers) or should be a instance, or should has a customer def原创 2022-06-19 21:00:25 · 1900 阅读 · 0 评论 -
Flops统计的Tensorflow2官方实现
Tensorflow2.9.1版本中加入的count flops的API原创 2022-06-13 20:10:13 · 1635 阅读 · 10 评论 -
tensorlfow中的KLDivergence与pytorch的KLDivLoss使用差异
pytorch中的手册:torch.nn.KLDivLosskl_loss = nn.KLDivLoss(reduction="batchmean")# input should be a distribution in the log spaceinput = F.log_softmax(torch.randn(3, 5, requires_grad=True))# Sample a batch of distributions. Usually this would come from the原创 2022-04-18 16:43:58 · 1640 阅读 · 0 评论 -
tensorflow中的KLDivergence的使用示例
loss = y_true * log(y_true / y_pred)情况一:算两个一维数组参考:tf.keras.losses.KLDivergencek = tf.keras.losses.KLDivergence()loss = k([.4, .9, .2], [.5, .8, .12])print('Loss: ', loss.numpy()) # Loss: 0.11891246情况二:按batch来算参考:TensorFlow->API->TensorFlow原创 2022-04-17 21:21:34 · 1095 阅读 · 0 评论 -
Tensorflow中的fft与rfft(一维数据为例)
tf.signal.ffttf.signal.fft( input, name=None)根据最里面的维度计算一维离散傅里叶变换(DFT)参数Input : complex64和complex128 类型的张量(Tensor)name : 操作的名字(可选)返回与Input相同类型的一个Tensor.使用方法:a = tf.ones([4])a_complex = tf.complex(a,tf.zeros(a.shape)) #先构造一个复数b = tf.signal.原创 2022-03-30 22:25:16 · 5903 阅读 · 0 评论 -
failed to query event: CUDA_ERROR_ILLEGAL_INSTRUCTION: an illegal instruction was encountered
报错信息:Error polling for event status: failed to query event: CUDA_ERROR_ILLEGAL_INSTRUCTION: an illegal instruction was encountered2022-03-24 23:32:13.170887: F tensorflow/core/common_runtime/gpu/gpu_event_mgr.cc:273] Unexpected Event status: 1情况描述:我自定.原创 2022-03-24 23:41:49 · 3122 阅读 · 0 评论 -
numpy.angle角度制的取值
numpy.angle角度值的取值范围就是跟正弦函数sin一样原创 2022-03-22 22:00:14 · 2492 阅读 · 0 评论 -
群联2251-07 海力士TLC-16K 颗粒 U盘重新量产记录
如图,金士顿DataTraveler 读文件时候发现经常出现错误,用DiskGenuis一看发现很多坏块,打算重新量产。先用ChipGenuis看一眼主控是群联PS2251-07的主控,固件版本是05.00.50 海力士TLC颗粒在http://www.upantool.com/liangchan/Phison/) 和upan.cc(http://www.upan.cc/tools/mass/Phison找了半天量产工具都不合适,报错。然后参考https://blog.youkuaiyun.com.原创 2022-03-03 22:43:27 · 10339 阅读 · 0 评论