自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(28)
  • 收藏
  • 关注

原创 Ubuntu 16.04 开启 telnet,telnet: Unable to connect to remote host: Connection refused

安装 openbsd-inetd、telnetdsudo apt-get install openbsd-inetdsudo apt-get install telnetd重启 telnet 服务sudo /etc/init.d/openbsd-inetd restart查看 telnet 运行状态netstat -a | grep telnet

2020-06-08 16:10:41 1286 1

原创 Python 读写 json 文件

import json# 读取 jsonafter = []with open("1.json", 'r') as f: data = json.load(f) print(type(data)) after = data# 修改相应值for k in range(len(after)): after[k]['scale_provid...

2019-04-30 11:13:23 167

原创 Keras ModelCheckpoint 保存最佳模型

回调函数 Callbacks 是一组在训练的特定阶段被调用的函数集,你可以使用回调函数来观察训练过程中网络内部的状态和统计信息。然后,在模型上调用 fit() 函数时,可以将 ModelCheckpoint 传递给训练过程。训练深度学习模型时,Checkpoint 是模型的权重。ModelCheckpoint 回调类允许你定义检查模型权重的位置,文件应如何命名,以及在什么情况下创建模型的 Ch...

2018-09-25 15:51:47 20177 17

原创 Win 10 关闭电脑休眠功能

休眠需要与内存大小同等的磁盘空间,占用 C 盘空间,并且台式机一般不需要休眠功能关闭休眠:在 C:\Windows\System32 目录下找到 cmd.exe,以管理员身份运行,然后在命令行中输入:powercfg -h off开启休眠:在命令行中输入 :powercfg -h on...

2018-09-24 09:07:33 4710 2

原创 ImportError : Failed to import pydot. You must install pydot and graphviz for `pydotprint` to work.

keras 模型可视化:plot_model首先安装 pydot_ng:pip install pydot_ng然后安装 graphviz:从 https://graphviz.gitlab.io/download/ 下载 windows 二进制安装版本——选择graphviz-2.38.msi 安装安装后还要把  graphviz 安装路径添加到环境变量中在程序中添加下列...

2018-09-03 10:56:33 6240 1

原创 ModuleNotFoundError: No module named ' '

python 导入模块报错如果要使用的模块(py文件)和当前模块在同一目录,只要 import 相应的文件名就好;如果要 import 一个不同目录的文件,可以使用  sys.path.append() 添加路径,在程序中添加下面两行代码。import syssys.path.append("导入模块的文件目录")运行 scaled_mnist.py 调用 deform_con...

2018-08-28 16:35:42 2598

原创 《 笨方法学 Python 》_ 习题 44

习题 44:继承与合成

2018-06-06 09:47:33 625 1

原创 《 笨方法学 Python 》_ 习题 43

习题 43:基本的面向对象分析和设计类的层次结构图* Map - next_scene - opening_scene* Engine - play* Scene - enter * Death * Center Corridor * Laser Weapon Armory * The Bridge * Escape ...

2018-06-05 20:19:09 1038

原创 《 笨方法学 Python 》_ 习题 40 - 42

习题 40:模块、类和对象

2018-06-04 19:36:47 1471 2

原创 《 笨方法学 Python 》_ 习题 38 - 39

习题 38:列表的操作ten_things = "Apples Oranges Crows Telephone Light Sugar"print("Wait there's not 10 things in that list, let's fix that.")stuff = ten_things.split(' ')more_stuff = ["Day", "Night", "So...

2018-06-03 21:18:37 788

原创 《 笨方法学 Python 》_ 习题 35 - 37

习题 35:分支和函数from sys import exitdef gold_room(): print("This room if full of gold. How much do you take?") next = input("> ") if "0" in next or "1" in next: how_much = int...

2018-06-03 12:50:47 399

原创 《 笨方法学 Python 》_ 习题 32 - 34

习题 31:循环和列表the_coount = [1, 2, 3, 4]fruits = ['apples', 'oranges', 'pears', 'apricots']change = [1, 'pennies', 2, 'dimes', 3, 'quarters']# this first kind of for-loop goes through a listfor numbe...

2018-06-03 09:45:44 332

原创 《 笨方法学 Python 》_ 习题 27 - 31

习题 27:记住逻辑关系    逻辑术语 and 与 or 或 not 非 != 不等于 == 等于 >= 大于等于 <= 小于等于 Tru...

2018-06-02 21:28:36 318 1

原创 《 笨方法学 Python 》_ 习题 26

习题 26 :恭喜你,现在可以考试了!这个习题的目的不是写程序,而是修正现有的程序,你需要访问网站 https://learnpythonthehardway.org/exercise26.txt,从那里把代码复制粘贴过来,命名为 ex26.py 。def break_words(stuff): """This function will break up words for us."""...

2018-06-02 12:51:23 964

原创 《 笨方法学 Python 》_ 习题 24 - 25

习题 24:更多练习print("Let's practice everything.")print('You\'d need to know \'bout escapes with \\ that do \n newlines and \t tabs.')poem = """\tThe lovely worldwith logic so firmly plantedcannot di...

2018-06-02 11:24:28 402

原创 《 笨方法学 Python 》_ 习题 18 - 23

习题 18:命名、变量、代码和函数# this one is like your scripts with argvdef print_two(*args): arg1, arg2 = args print("arg1: %r, arg2: %r" % (arg1, arg2)) # ok, that *argv is actually pointless, we ca...

2018-06-01 22:42:01 816

原创 《 笨方法学 Python 》_ 习题 15 - 17

习题 15:读取文件这个习题涉及写两个文件,一个是 ex15.py 文件,另外一个是 ex15_sample.txt,是供你的脚本读取的文本文件。下面是该文本文件的内容。This is stuff I typed into a file.It is really cool stuff.Lots and lots of fun to have in here.from sys import argv...

2018-06-01 17:10:36 734

原创 《 笨方法学 Python 》_ 习题 13 - 14

习题 13:参数、解包和变量一个可以接受参数的脚本from sys import argvscript, first, second, third = argvprint("The script is called:", script)print("Your first variable is:", first)print("Your second variable is:", sec...

2018-05-31 21:38:05 731

原创 《 笨方法学 Python 》_ 习题 10 - 12

习题 10:那是什么# 使用反斜杠(\)可以将难打印出来的字符放到字符串tabby_cat = "\tI'm tabbed in."persian_cat = "I'm split\non a line."backslash_cat = "I'm \\ a \\ cat."# 可以在一组三引号之间放入任意多行的文字fat_cat = """I'll do a list:\t* Ca...

2018-05-31 17:43:16 315

原创 《 笨方法学 Python 》_ 习题 6 - 9

习题 6:字符串和文本x = "There are %d types of people." % 10binary = "binary"do_not = "don't"# 如果在字符串中通过格式化字符放入多个变量,需要将变量放到()中,变量之间用逗号隔开y = "Those who know %s and those who is %s." % (binary, do_not)pri...

2018-05-31 16:17:51 706

原创 《 笨方法学 Python 》_ 习题 2 - 5

习题 2:注释和 # 号# A comment, this is so you can read your program later.# Anything after the # is ignored by python.print("I could have code like this.") # and the comment after is ignored# You can a...

2018-05-30 21:11:06 432

原创 《 笨方法学 Python 》_ 习题 1

习题 1:第一个程序print("Hello World!")print("Hello Again")print("I like typing this.")print("This is fun.")print("Yay! Printing.")print("I'd much rather you 'not'.")print('I "said" do not

2018-05-30 19:41:03 308

原创 《 笨方法学 Python 》_ 目录

《 笨方法学 Python 》(第 3 版)书中代码是 Python 2 版本,但 Python 核心团队计划在 2020 年停止支持 Python 2,Python 3 大势所趋。本着学习 Python 3 的目的,用 Python 3 完成本书的习题。作者 Zed A. Shaw 也写了 Python 3 版本:Learn Python the Hard Way人生苦短,我用 Python。...

2018-05-30 19:03:17 1120

原创 Crowd Counting(人群计数)

Single-Image Crowd Counting via Multi-Column Convolutional Neural Network(CVPR_2016)We have proposed a simple but effective Multi-column Convolutional Neural Network (MCNN) architecture to map the ima...

2018-05-28 11:14:37 3133

原创 Convolutional Neural Network Architecture

Convolutional Neural Network Architecture

2018-05-27 22:16:29 382

原创 Tensorflow 图像处理函数

RGB 色彩模式的图像需要解码才能还原成一个三维矩阵Tensorflow提供了对 jpeg 和 png 格式图像的编码 / 解码函数tf.image.decode_jpeg()tf.image.decode_png()在图像处理前将图片数据转化为实数类型,即将 0 ~ 255 的像素值转化为 0.0 - 1.0 范围内的实数。tf.image.convert_image_dtype(image_...

2018-05-15 17:26:11 278

原创 tf.train.Saver()

tf.train.Saver() 保存和加载模型 saver = tf.train.Saver()saver.save(sess,  '路径 + 模型文件名')在创建这个 Saver 对象的时候, max_to_keep 参数表示要保留的最近检查点文件的最大数量,创建新文件时,将删除旧文件,默认为 5(即保留最近的 5 个检查点文件),max_to_keep=5。saver ...

2018-05-15 16:39:57 31121 2

原创 os.listdir()

os.listdir(path) 返回指定路径下所有文件和文件夹的名字,并存放于一个列表中。import osfile_dir = "./"file_name = os.listdir(file_dir)# 以列表形式存放print(file_name)for name in file_name: print(name)...

2018-05-15 15:23:38 23272

空空如也

空空如也

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

TA关注的人

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