自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 【screen】配置与操作

快捷键命令说明control + a + d退出screenscreen -m有作业情况下,建立新的screen作业screen -r {PID}进入指定的screen作业screen -ls显示当前所有的screen作业screen无作业情况下,建立新的screen作业ctr a + ctr a单screen中切换viewct...

2020-03-16 23:18:16 289

原创 【vim】配置与操作

配置修改当前用户的Vim配置:vim ~/.vimrc填写信息如下:set ts=4set expandtabset autoindent使之生效:source ~/.vimrc快捷键命令说明0行首$ (shift+6)行尾gg文首G(shift+g)文尾A(Shift+a)文尾,并编辑ctrl + f向上翻整...

2020-03-16 23:16:13 205

原创 【iterm2】配置与操作

配置iterm2完全参照这篇文章即可:Mac OS 终端利器 iTerm2iterm2操作命令说明command + t新建标签command + w关闭标签command + 数字、command + 左右方向键切换标签command + enter切换全屏command + f查找command + d垂直分屏comma...

2020-03-16 22:27:20 351

原创 【tensorflow】按名查看变量

法一specified_var_lst = [v for v in tf.global_variables() if "conv_1/" in v.name]print(specified_var_lst)法二for i, v in enumerate(specified_var_lst): print('\n {}/{} {} : \n {} '.format(i, len(sp...

2020-03-15 16:02:16 304

原创 【tensorflow】tensorflow如何避免内存泄漏

注意事项注意graph一定要用 sess.graph.finalize(),相当于把整个图冻住,使图变为只读的形式,不再允许增加节点。注意循环循环中禁用如下可能会改变图节点的函数: tf.convert_to_tensor() tf.reshape() tf.cast() tf.zeros_like() tf.ones_like() tf.assign() tf.train....

2020-03-15 15:54:06 1789

原创 【tensorflow】TFRecord读写机理

tfrecord,写的时候是一行一行地写的,读的时候是每batch个行地读的。写的时候,通过for循环(例如:img_path, cls_label = img_paths[i], cls_labels[I])往tf.train.Example里面喂feature。因此,tf.train.Example中的feature喂入的是单行的数据(包括一个img_path、及其对应的encod...

2020-03-15 15:48:08 265

原创 【pytorch】安装pytorch

安装通过condaconda install pytorch torchvision -c pytorch通过pippip install torch torchvision

2020-03-15 15:40:44 678

原创 VSCode相关操作

选取Python解释器使用 Ctrl+Shift+P打开命令板:输入 Python: Select Interpreter进行搜索。接下来会显示VSCode所能找到的全部解释器,选择你需要的哪个就好。...

2020-03-15 15:37:18 238

原创 安装horovod

安装ompi准备ompi安装包下载ompi:https://github.com/open-mpi/ompi/releases版本建议大于4.0.0。因为发现openmpi-4.0.0里面没有configure,只找到config,因此我自己用的是openmpi-4.0.1.tar.gz。把ompi压缩包上传到要安装horovod的服务器。安装ompi我没有完全按照ho...

2020-03-15 15:33:57 2031 3

原创 【tensorflow】安装tensorflow

安装TensorFlow有Cuda检查可安装的tensorflow-gpu版本范围:安装:pip install tensorflow-gpu无Cuda检查可安装的tensorflow版本范围:安装:pip install tensorflow

2020-03-15 15:26:03 218

原创 protobuf相关操作与问题

查看查看protobuf版本protoc --version查看protobuf安装路径which protocNote:虽然 pip show protobuf也可以看到protobuf的相关信息,但是所指向的可能不是同一个protobuf,通过 which protobuf可看出。问题遇到protobuf版本不对卸载原有protobufpip uninstall p...

2020-03-15 15:22:46 414

原创 【opencv】安装opencv

安装根据实际安装需要,选择 “仅安装python接口” 或 “同时安装python/c++接口” 其中一种即可。仅安装python接口仅支持TensorFlow、PyTorch,不支持Caffe。pip install opencv-python若pip不能正常使用,则去 清华大学镜像站 中找到最新版的opencv包(.whl文件),下载之。直接pip install下好的安装包p...

2020-03-15 15:19:20 243

原创 安装OpenBLAS

安装Linux以安装0.2.20版本的OpenBLAS举例。直接下载或上传 OpenBLAS-0.2.20.tar.gz 到待安装目录。解压tar -zxvf OpenBLAS-0.2.20.tar.gz编译make -j8安装sudo make install判断安装成功:/opt/OpenBLAS/ 目录存在cd /opt/OpenBLAS/...

2020-03-15 15:16:13 820

原创 【python】pip指定源

永久性指定源编辑 ~/.pip/pip.conf:mkdir ~/.pipvim ~/.pip/pip.conf写入如下内容:[global]trusted-host = xxxxindex-url = xxxx立即生效:source ~/.pip/pip.conf临时性指定源pip install {库名} --index='xxxx' --trusted-host=...

2020-03-15 15:11:56 383

原创 安装anaconda

安装Linux下bash {anaconda的.sh安装包}MacOS下点击解压,根据提示来装路径配置将anaconda的路径写入到 $PATH 中vim ~/.bashrcsource ~/.bashrc检查当前的python路径which python...

2020-03-15 15:08:24 144

原创 【linux】安装cuda+cudnn

检查DriverNote:一台机器只能对应一个nvidia driver,而一个nvidia driver可以对应多个cuda。只要在自己的路径下把cuda指定成特定版本就行。尽量不要使用/usr/local/下面的默认cuda/,防止因为ln对象会发生变化而造成影响。nvidia driver版本 决定了 可用的cuda范围,进而决定了 可用的tensorflow-gpu版本。所以,每...

2020-03-15 15:04:49 416

原创 【XOS】Mac关闭应用

关闭应用点击要关闭的应用command + q

2020-03-15 15:00:05 227

原创 【XOS】Mac关闭Finder

关闭Finder一共有三种方法。通过killall指令在命令行输入:killall Finder通过快捷键点击要关闭的文件夹command + option + w通过活动监视器在启动台搜 活动监视器,找到 “Finder” 并 “强制退出” 。...

2020-03-15 14:57:00 1012

原创 【tkinter】辨识键盘输入

前言在使用tkinter的时候经常会不知道某个键盘具体对应的 event.char和event.keycode是什么,上网去查找又很麻烦。Code以下是我总结的模板,专门用于辨识键盘输入:import sysif sys.version_info.major >= 3: from tkinter import *else: from Tkinter import ...

2020-03-15 10:55:20 892

原创 【web】python web框架比较(Django、Flask、Tornado)

前言博主之前没接触过Web开发,只是想用Python Web框架开发一个小工具。临时上网调研了一下常用的三大python web框架(Django、Flask、Tornado),记录如下:Django:大而全;Flask:短小灵活,但就是太灵活了其实对新手来说不好控制;Tornad:短小灵活,天生异步处理强。较为原始。因为我只需要开发一个小工具,所以肯定不选Django。看了一下Fl...

2020-03-15 09:46:03 1343

原创 【python】如何写出兼容py2与py3的代码

【python】如何写出兼容py2与py3的代码

2020-03-13 22:03:55 1077 1

原创 【tensorflow】设置显存开销

问题一般大家在跑tf时,单个程序往往会占满整块GPU的所有显存。但是实际上,程序很可能并不需要那么大的显存空间。改进方案通过 tf.ConfigProto().gpu_options.allow_growth=True来告诉程序,只需占用实际所需的显存即可:# ---------------- session ----------------config = tf.ConfigProt...

2020-03-13 20:33:27 358

原创 【python】理解 __file__

py3下,__file__返回的是文件的 绝对地址 ;而在py2下,__file__返回的是文件的 相对地址 。想在py2下获取文件的绝对地址,可以借助 os.path.abspath():import osprint(os.path.abspath(__file__))即可获取绝对地址。...

2020-03-13 20:27:05 325

原创 macOS:删除DNS

问题Mac显示已连接Wifi,但是无法正常使用网络。解决方案清空现有DNS:mac -> 系统偏好设置 -> 网络 -> 高级 -> DNS -> 手动清空所有的IP

2020-03-12 14:06:29 1991

原创 【opencv】cv::Mat 公有成员函数 (Public Member Func)

Public Member Funcchannels()Mat矩阵元素拥有的通道数。depth()用来度量每一个像素中每一个通道的精度,但它本身与图像的通道数无关。depth数值越大,精度越高。Mat.depth()得到的是一个0~6的数字,分别代表不同的位数,对应关系如下:enum{CV_8U=0,CV_8S=1,CV_16U=2,CV_16S=3,CV_32S=4,CV_32F...

2020-03-11 22:27:30 571

原创 【opencv】cv::Mat 图像格式 (Data Type)

OpenCV使用Mat存图像,有专门的图像格式。命名规则通用的参数命名格式为:CV_{元素比特数}{元素类型}C{通道数}例如,最常见的 CV_8UC3 中:8U:8bit unsigned ;C3:通道数为 3 。因此,CV_8UC3 就表示为 3通道Unsigned 8bits 格式的矩阵,也就是我们常说的 BGR3通道 。类似的还有:CV_8UC1,CV_8UC2...

2020-03-11 21:57:37 4798

原创 【opencv】cv::Mat 公有属性 (Public Attributes)

作用图像在OpenCV中都是通过Mat类来存储的,Mat可以用来表示N维矩阵。Public Attributes主要包含两部分:用来描述矩阵的头信息;data指针,指向Mat中存储的数据。typeattr备注MatAllocator *allocatorconst uchar *dataendconst uchar *datalimit...

2020-03-11 18:09:35 412

原创 【opencv】cv头文件

需要调用到opencv的什么功能,就在代码头提前引用好对应的头文件。所有的头文件都可以在include/opencv2/文件夹找到。以下列举比较重要的:#include "opencv2/core/core_c.h"#include "opencv2/core/core.hpp"#include "opencv2/flann/miniflann.hpp"#include "opencv...

2020-03-11 16:48:20 1810

原创 git:快速拉取特大仓库

问题对于特别大的仓库,直接clone需要耗时很久很久。解决方法建议直接新建一个空仓库,然后pull特定的分支即可。具体操作建议直接mkdir相应的仓库名称:mkdir {repo名称} 转为git仓库(即:新建.git/):git init配置好remote origin:git remote add origin {repo上游地址}只拉取特定分支即...

2020-03-10 16:04:34 1166

原创 【深度学习】基础网络 (Basemodel) 综述

【深度学习】基础网络 (Basemodel) 综述

2019-01-23 12:35:55 3144 2

原创 【深度学习】目标检测 (Detection) 算法综述

【深度学习】目标检测 (Detection) 算法综述

2019-01-23 11:25:46 4273 1

原创 【leetcode】排序算法

冒泡排序def bubble_sort(x): for i in range(len(x)): for j in range(1, len(x)-i): if x[j-1] > x[j]: x[j-1], x[j] = x[j], x[j-1] return x插入排序def insert_sor...

2018-11-08 11:22:11 542

原创 leetcode: 449. Serialize and Deserialize BST

DifficultyMedium.ProblemSerialization is the process of converting a data structure or object into a sequence of bits so that it can be stored in a file or memory buffer, or transmitted across a ne...

2018-11-08 11:17:44 362

原创 leetcode: 215. Kth Largest Element in an Array

DifficultyMedium.ProblemFind the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element.Example 1:Input: [3,2,1,5,6...

2018-11-08 11:16:00 341

原创 leetcode: 206. Reverse Linked List

DifficultyEasy.ProblemReverse a singly linked list.Example:Input: 1->2->3->4->5->NULLOutput: 5->4->3->2->1->NULLFollow up:A linked list can be reversed either ...

2018-11-08 11:14:21 330

原创 leetcode: 144. Binary Tree Preorder Traversal

DifficultyMedium.ProblemGiven a binary tree, return the preorder traversal of its nodes' values.Example:Input: [1,null,2,3] 1 \ 2 / 3Output: [1,2,3]Follow up: Recursive so...

2018-11-08 11:12:15 220

原创 leetcode: 141. Linked List Cycle

DifficultyEasy.ProblemGiven a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?AC# Definition for singly-linked list.# class ListNode(objec...

2018-11-08 11:09:57 219

原创 leetcode: 122. Best Time to Buy and Sell Stock II

DifficultyEasy.ProblemSay you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may complete as many transactions ...

2018-11-08 11:07:36 302

原创 leetcode: 129. Sum Root to Leaf Numbers

DifficultyEasy.ProblemSay you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may complete as many transactions...

2018-11-08 11:01:33 237

原创 leetcode: 121. Best Time to Buy and Sell Stock

DifficultyEasy.ProblemSay you have an array for which the ith element is the price of a given stock on day i.If you were only permitted to complete at most one transaction (i.e., buy one and sel...

2018-11-07 09:13:07 282

Pycharm简洁高效的主题设置

这是我在日常使用Pycharm IDE过程中,根据个人喜好所逐渐形成的一整套主题设置。主要亮点:简洁高效。欢迎下载。

2018-01-01

空空如也

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

TA关注的人

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