![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
noirblack
这个作者很懒,什么都没留下…
展开
-
AttributeError: partially initialized module ‘cv2‘ has no attribute ‘_registerMatType‘
AttributeError: partially initialized module 'cv2' has no attribute '_registerMatType'原创 2022-06-17 14:40:51 · 16569 阅读 · 8 评论 -
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 · 544 阅读 · 0 评论 -
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 · 4294 阅读 · 0 评论 -
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 · 362 阅读 · 0 评论 -
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 · 582 阅读 · 0 评论 -
Python并行计算简单实现
Python并行计算简单实现multiprocessing包是Python中的多进程管理包. Pool(num)类提供一个进程池,然后在多个核中执行这些进程, 其中默认参数num是当前机器CPU的核数.Pool.map(func, iterable[, chunksize=None]) 2个参数, 第一个参数是函数, 第二个参数是需要可迭代的变量, 作为参数传递到func如果原创 2018-01-15 19:49:14 · 14028 阅读 · 1 评论 -
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 · 849 阅读 · 1 评论 -
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 · 7228 阅读 · 0 评论 -
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 · 19971 阅读 · 1 评论