自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 AttributeError: partially initialized module ‘cv2‘ has no attribute ‘_registerMatType‘

AttributeError: partially initialized module 'cv2' has no attribute '_registerMatType'

2022-06-17 14:40:51 16654 8

原创 TensorFlow系列: tf.shape() 与 tensor.get_shape()

tf.shape()shape( input, name=None, out_type=tf.int32) 返回一个代表 input 的 shape 的 1-D tensor.也就是说获得shape的信息,需要用sess.run().>>> import tensorflow as tf>&a

2018-05-15 18:59:48 7235

原创 deeplearning.ai 编程作业问题总结 Neural Networks and Deep Learning

Week2 Logistic Regression with a Neural Network mindset在做编程作业的时候遇到了一个很奇怪的 现象:实现模型的准确率(accuracy)总是很低(~34)。 检查:每一步中间结果,初始化,前向,计算loss,计算梯度,更新参数,预测都可以得到预期的输出。 调参:以为是参数没有设置好,尝试调整,learning_rate和迭代次数。 ...

2018-05-01 23:25:39 858 1

原创 Python并行计算简单实现

Python并行计算简单实现multiprocessing包是Python中的多进程管理包. Pool(num)类提供一个进程池,然后在多个核中执行这些进程, 其中默认参数num是当前机器CPU的核数.Pool.map(func, iterable[, chunksize=None]) 2个参数, 第一个参数是函数, 第二个参数是需要可迭代的变量, 作为参数传递到func如果

2018-01-15 19:49:14 14052 1

原创 TensorFlow 排序,ranking

计算 ranking loss 时候可能需要对 tensor 进行排序和获取对应的index, 下面介绍用两个TF的函数完成获取从小到大index的方法:有一个 tensor,[9, 4, 5], 想得到它从小到大的排序的index [1, 2, 0] TF中有函数 tf.nn.top_k(·) 和tf.reverse(·)完成import tensorflow as tfa = tf.con

2017-09-25 20:13:46 8199 1

原创 python 文件查操作汇总

python collection 文件查找与移动一. 找出文件夹下面所有的 ‘.jpg’ 文件import os.pathimport glob# 你的文件夹路径dir = '/your/directory/'pattern = '*.jpg' # Get all jpg file names.filenames = glob.glob(os.path.join(dir, pattern)

2017-09-20 20:01:33 363

原创 TensorFlow, numpy中的broadcast机制

numpy 有 broadcast 机制,使用它可以让我们的代码更加方便。 TensorFlow 有不少操作支持 broadcast. 通常来说,我们对 numpy 的 ndarray 或者 TensorFlow 中的 tensor 进行 element-wise 操作都要求两个变量的 shape 保持一直。a = np.random.rand(3, 4)b = np.random.rand(

2017-09-19 20:06:26 4309

原创 Python dictionary 汇总

这篇博客主要是总结使用python的dictionary使用方法和技巧list 转 dict 使用dict的内置方法: fromkeys()Syntax dict. fromkeys(iterable[, value]) iterable: 必选参数,可迭代的object value:可选参数,默认为None Return: 返回一个dictPython 字典(Dictionary) f

2017-09-14 17:40:26 546

原创 Ubuntu 源码编译安装 GPU版 TensorFlow

- 从github下载 Tensorflow 源码$ git clone https://github.com/tensorflow/tensorflow 查看当前分支, 根据需求切换到指定分支, e.g. r1.3$ cd tensorflow$ git checkout Branch # where Branch is the desired branch$ git checkout r1.

2017-09-14 16:58:43 586

原创 TensorFlow Serving,GPU版安装

TensorFlow Serving,GPUTensorflow serving 是一个开源的工具,主要用来部署训练好的模型,进行Inference。 Tensorflow serving Github地址 本文主要介绍tensorflow serving的安装,支持GPU模型。安装依赖BazelTensorFlow Serving 要求0.4.5以上的Bazel。Bazel 的安装说明her

2017-07-06 16:14:23 8263 1

原创 Tensorflow: 从checkpoint文件中读取tensor

在使用pre-train model时候,我们需要restore variables from checkpoint files. 经出现在checkpoint 中找不到”Tensor name not found”. 这时候需要查看一下ckpt中到底有哪些变量from tensorflow.python import pywrap_tensorflowcheckpoint_path = os

2017-05-08 20:10:46 17617 10

原创 Tensorflow 多GPU下,指定使用某一块GPU, 多块, 禁用

如果机器中有多块GPU,tensorflow会默认吃掉所有能用的显存, 如果实验室多人公用一台服务器,希望指定使用特定某块GPU。 可以在文件开头加入如下代码:import osos.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"os.environ["CUDA_VISIBLE_DEVICES"] = "1"指定使用第二块GPU(从0开始)

2017-04-26 11:49:32 19976 1

原创 caffe, Inception v2 Check failed: top_shape[j] == bottom[i]->shape(j)

使用Caffe 跑 Google 的Inception V2 对输入图片的shape有要求,某些shape输进去可能会报错。 Inception model中有从conv和pooling层concat的操作,而conv和pooling的output输出计算方式不完全一样。解决方案: 1. 按照原来prototxt输出图片 2. 把concat层前面stride为2的conv层替换stride为

2017-04-18 20:02:35 2581 1

原创 GPU Memory exhausted, but no process listed by nvidia-smi

Ubuntu 14.04 下,使用nvidia-smi 查看显卡使用情况,型号为GTX Titain-X,并没有显示占用显存的process,但是显示显存使用情况已经11G+。可能原因是使用 **.sh文件调用的caffe的train_net.py意外终止,找到占用GPU资源的PID然后kill了就可以了。$ sudo fuser -v /dev/nvidia*该命令会可以查出占用显卡资源的PID。

2017-04-18 09:46:50 2162

数字通信—基础与应用(第二版

数字通信—基础与应用(第二版)Bernard Sklar著

2012-04-08

空空如也

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

TA关注的人

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