- 博客(38)
- 资源 (2)
- 收藏
- 关注
原创 Python 调试打印变量名
python 在调试过程中需要打印变量名称和打印变量值, 下面代码可以实现:def tiaoshi(name, locals): print(locals) for key in locals: if locals[key] == name: print(key) print(name) input() ...
2018-12-11 21:45:56
2991
原创 python3 搭建简单的文件服务器
实验环境: Ubuntu 16.04 python3.5.2python -m http.server 端口在浏览器中打开ip:端口
2018-10-17 10:16:30
4048
1
原创 jupyter 使用
安装pip3 install jupyter运行帮助jupyter notebook -h指定端口和ipjupyter notebook --ip 0.0.0.0 --port 20000 --no-browser在浏览器上运行 http://(ip):20000/?token=...
2018-10-15 14:15:30
270
原创 tensorflow 打印pb模型的所有节点
只有pd模型文件, 打印所有节点from tensorflow.python.framework import tensor_utilfrom google.protobuf import text_formatimport tensorflow as tffrom tensorflow.python.platform import gfilefrom tensorflow.python...
2018-10-10 16:28:10
8524
原创 docker中实验 tensorboard 显示pb图结构
实验在docker中进行, 所以 ip 为 0.0.0.0import tensorflow as tffrom tensorflow.python.platform import gfilegraph = tf.get_default_graph()graphdef = graph.as_graph_def()graphdef.ParseFromString(gfile.FastGF...
2018-10-10 15:38:50
590
原创 自动生成和安装requirements.txt依赖
requirements.txt可以通过pip命令自动生成和安装生成requirements.txt文件pip freeze > requirements.txt安装requirements.txt依赖pip install -r requirements.txt
2018-10-10 11:54:25
1829
1
原创 python去除字符串首尾的空格
strip是trim掉字符串两边的空格。lstrip, trim掉左边的空格rstrip, trim掉右边的空格theString = ' kljll ' print theString.strip()# kljll
2018-10-10 11:53:31
29849
1
原创 python 安装gevent 问题
pip3 install geventCollecting geventException:Traceback (most recent call last): File "/usr/share/python-wheels/urllib3-1.13.1-py2.py3-none-any.whl/urllib3/connection.py", line 137, in _new_conn...
2018-10-10 10:36:02
4074
2
原创 python 错误集合
OSError: raw write() returned invalid length 94 (should have been between 0 and 47)在vscode实验python程序时, 出现上面错误.解决方法:安装win_unicode_console:pip install win_unicode_console在代码中加入:import win_unicode...
2018-10-04 13:52:52
562
原创 图像风格迁移docker内实验详细记录
开发平台: Ubuntu 16.04安装docker-ce, docker, nvidia-docker 1.1, docker-compose预处理:制作数据卷nvidia_driver_384.111制作镜像mkdir -p /your_pathcd /your_path## git clone https://github.com/NVIDIA/FastPhotoStyle...
2018-09-30 11:51:03
421
原创 from torch._C import * ImportError: DLL load failed: 找不到指定的模块
在做pytorch研发时候出现这个错误解决方案:升级到numpy-1.14.6+mkl-cp35-cp35m-win_amd64.whlpip install numpy-1.14.6+mkl-cp35-cp35m-win_amd64.whl
2018-09-30 11:39:15
5170
4
原创 查看并升级tensorflow版本
python版本import tensorflow as tftf.__version__查询tensorflow安装路径为:tf.__path__升级pip install --upgrade tensorflow-gpu## 升级到固定版本pip install tensorflow-gpu==1.7.0...
2018-09-30 11:23:45
6937
原创 CUDA driver version is insufficient for CUDA runtime version 问题解决
CUDA driver version is insufficient for CUDA runtime version简单的讲, cuda驱动版本和cuda库的版本不一致.常见错误场景: cuda驱动最高支持cuda90的库, 如果用cuda91的库, 会出现这种情况两种解决思路:升级cuda驱动降低cuda91库为cuda90建议选择第二种解决方案....
2018-09-29 09:59:02
4305
原创 Dockerfile模板
下面是比较欣赏的Dockerfile模板.Dockerfile模板层次比较清晰如果一次构建失败, 可以重复构建不同镜像可以复用构建过程的层FROM nvidia/cuda:9.0-cudnn7-devel-ubuntu16.04RUN APT_INSTALL="apt-get install -y --no-install-recommends" && \ ...
2018-09-28 14:59:15
1193
原创 docker 常见错误
出现错误:Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?sudo systemctl status docker● docker.service - Docker Application Container Engine Loaded:...
2018-09-27 16:24:20
362
原创 c++ 打印当前时间
#include <iostream>#include <ctime>using namespace std;int main(){ // 基于当前系统的当前日期/时间 time_t now = time(0); cout << "1970 到目前经过秒数:" << now << endl; tm *ltm =...
2018-09-27 10:51:28
13264
原创 ncnn加速三大技巧
ncnn加速, 不同于模型量化压缩, 而是采用另一种加速技巧.例如下面的几种:使用低精度例如: caffe2ncnn.cpp 中代码// convert float to half precision floating pointstatic unsigned short float2half(float value){ // 1 : 8 : 23 union ...
2018-09-27 10:23:47
7464
原创 ncnn 测试mobilessd模型
实验平台Ubuntu 16.04 docker安装opencvbuildcd <ncnn-root-dir>mkdir -p buildcd buildcmake ../make -j32完全编译在主CMakeLists.txt 文件中注释去掉# add_subdirectory(examples)# add_subdirectory(benchmark)...
2018-09-26 15:25:35
2143
原创 keras 模型参数详细
实验平台:win10 pro, python3.5.2,直接上代码from tensorflow import kerasfrom tensorflow.keras.models import Sequentialfrom tensorflow.keras.layers import Dense, Dropout, Flattenfrom tensorflow.keras.layers...
2018-09-24 13:34:27
2424
1
原创 fatal: open /dev/null or dup failed: No such file or directory
fatal: open /dev/null or dup failed: No such file or directorywin10专业版,在命令行使用git的时候出现此报错,解决方法:如下win 在别的win10专业版上的电脑上拷贝C:\Windows\System32\drivers文件夹中的null.sys文件到覆盖到相应目录下的相应文件, 如果不成功, 下面提供解决成功的文件:...
2018-03-13 09:44:57
1602
原创 c++ 记录程序运行时间
头文件#include <time.h>程序:clock_t start, end;start = clock();// 测试的程序std::cout << "time consume: " << (double)(clock() - start) / CLOCKS_PER_SEC << std::endl;
2017-09-19 17:52:03
1640
原创 python文件和目录操作
遍历所有文件 def browser(path, images_paths ): #path为需要遍历的路径 if not os.path.isdir(path): #判断path是否为路径 return for root, dirs, list in os.walk(path): for i in list: ...
2017-09-19 10:58:51
451
原创 不同编译器的类型字节
不同编译器影响指针变量和long变量 无符号long变量32位 char :1个字节char*(即指针变量): 4个字节(32位的寻址空间是2^32, 即32个bit,也就是4个字节。同理64位编译器)short int : 2个字节int: 4个字节unsigned int : 4个字节float: 4个字节double: 8个字节long: 4个字节long lon
2015-10-08 12:29:41
454
原创 c++ vector实验
#include #include #include #include #includeusing namespace std; int main(){ //初始化字符串容器方法1 vector v(5, "hello"); vector v2(v.begin(), v.end()); assert(v == v2); cout Before operation"
2015-10-06 00:12:25
624
原创 二进制“<<”: 没有找到接受“const std::basic_string<char,std::char_traits<char>,std::allocator<char>>”类型的右操作数的运算
少了 #include 头文件,加上就对了。
2015-10-05 23:34:38
4327
原创 一些线性代数的说法
一些说法的描述(学习记录)1、特征值分解可以得到特征值与特征向量,特征值表示的是这个特征到底有多重要,而特征向量表示这个特征是什么。2、一般来说,方差大的方向是信号的方向,方差小的方向是噪声的方向。3、每一维都除以标准差就得到了每一维的方差为1,也就是说方差相等
2015-10-02 22:11:24
395
原创 算法的简单描述
本文写给自己看,持续补充1、二叉树的前序为根左右,中序为左根右,后序为左右根(可以根据根的位置进行记忆);前序,后序可以定根,中序定左右支2、权值为1 4 6 8 0的5个叶子节点构造一棵哈夫曼树,选小两个的组成大的,再重复选3、度为0的节点数等于度为2的节点数加1
2015-10-01 20:28:46
584
原创 计算机网络常识
本文写给自己看,持续补充1、Ping程序的实现 1 实现方法是主机向远程计算机发出ICMP回显请求以后,远程计算机会拦截这个请求,然后生成一条一条回显应答信息,再通过网络传回给主机。 2 假如某些原因,不能抵达目标主机,就会生成对应的ICMP错误消息("比如 目标主机访问不可达"),由原先打算建立通信的那个路径上某处的一个路由器返回。 3 假定与主
2015-10-01 20:27:21
428
原创 计算机系统常识
本文写给自己看,持续补充1、32位系统中short占 2 字节,int 、float、long 都占 4 字节,double 和long long 占8 字节,可以用sizeof(int ),sizeof(float )等来测试。2、int a; int b; a+b 如果溢出相当于a+2^32-b;溢出不影响减法,但是影响除法;3、指针的位数为地址线的位数,64位
2015-10-01 20:26:42
228
原创 一般后特殊思维
阿里巴巴笔试某二维平面上有12个位置不同的点,通过连接其中任意两点,可以画出59条不同的直线。那么,在59条直线中,经过3个或3个以上的点的直线有()条。12个位置不同的点,通过连接其中任意两点,总共有C(12,2)=66(一般) 现有59条,说明7条是重复的(讨论特殊) 假如有3个点在一条线上,则C(3,2)-1=2条,会减少2条 假如有4个点在一条先上,
2015-10-01 16:26:37
362
原创 BFS与DFS
BFS的思想:从一个图的某一个顶点V0出发,首先访问和V0相邻的且未被访问过的顶点V1、V2、……Vn,然后依次访问与V1、V2……Vn相邻且未被访问的顶点。如此继续,找到所要找的顶点或者遍历完整个图。DFS的思想:深度优先搜索所遵循的策略就是尽可能“深”的在图中进行搜索,对于图中某一个顶点V,如果它还有相邻的顶点(在有向图中就是还有以V为起点的边)且未被访问,则访问此顶点。如果找
2015-10-01 15:24:32
277
原创 结构体的内存对齐
#include #include using namespace std;int _tmain(int argc, _TCHAR* argv[]){ struct Date { char a; int b; double c; char d; }; struct Date Date1 = { 'c', 1, 0.1, 'c' };
2015-10-01 14:50:21
320
原创 关于1<<32
int a = 1, b = 32; printf("%d", 1 << 32); //0 printf("%x", 1 << b); //1 printf("%d", a << b); //1 printf("%d", a
2015-10-01 09:52:04
1229
原创 360笔试题二:二元选择思维
有A,B,C三个学生,一个出生在北京,一个出生在上海,一个出生在广州。他们中一个学物理专业,一个学数学专业,一个学计算机。其中(1)A不是学物理的,B不是学计算机的;(2)学物理的不出生在上海;(3)学计算机的出生在北京;(4)B不出生在广州。请根据上述条件,判断A的专业()。
2015-09-30 23:52:48
525
原创 360笔试题一:时钟模型
上高中的小明暗恋女神三年,高考结束后,小明决定向女神表白。这天,小明来到女神楼下等待女神的出现,时间一分一秒的流逝,两个多小时过去了,女神还没有出现,小明看了下表,时针和分针的位置正好跟开始等的时候互换,请问小明一共等了女神多少分钟()
2015-09-30 23:45:04
405
原创 Matlab中常见的错误整理(待续)
1、Attempted to access image(0); index must be a positive integer or logical出错原因:MATLAB中的图像的是从坐标(1,1)开始的,for循环中不能从(0,0)开始。2、 ********* |Error: The input character is not valid in
2014-07-07 09:48:22
773
fatal: open /dev/null or dup failed: No such file or directory(解决文件)
2018-03-13
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人