摘要: ``` 注意和前一或二篇Lenet训练并验证的文章从 起的不同 部分函数请参照前后2篇文章 import tensorflow as tf import tfrecords2array import numpy as np from keras.utils import to_categorical 阅读全文
posted @ 2017-12-01 14:57 默盒 阅读(1526) 评论(0) 推荐(0) 编辑
摘要: ```python3 import os import shutil import tensorflow as tf import time import sys import cv2 # 图片存放位置 PATH_RES = [ r'data_tfrecords/integers_tfrecords/train.tfrecords', r'data_tfrecords/inte... 阅读全文
posted @ 2017-12-01 14:53 默盒 阅读(544) 评论(0) 推荐(0) 编辑
摘要: ```python3 # 部分函数请参考前一篇或后一篇文章 import tensorflow as tf import tfrecords2array import numpy as np import matplotlib.pyplot as plt from collections import OrderedDict def lenet(char_classes): y_tr... 阅读全文
posted @ 2017-12-01 14:52 默盒 阅读(972) 评论(0) 推荐(0) 编辑
摘要: ```python3 import numpy as np import tensorflow as tf import time import os import cv2 from sklearn.utils import shuffle # 图片存放位置 PATH_DES = [ r'data_tfrecords/integers_tfrecords/', r'data_t... 阅读全文
posted @ 2017-12-01 14:50 默盒 阅读(335) 评论(0) 推荐(0) 编辑
摘要: argparse"应用"于jupyter notebook中 args.xx ======================= args["xx"] argparse.ArgumentParser() ======= dict 想要有输入, 加个input()即可解决, 也算是低配仿制版吧, 哈哈. 阅读全文
posted @ 2017-11-20 19:49 默盒 阅读(575) 评论(0) 推荐(0) 编辑
摘要: 在终端输入: , 并将其内容 添加至Pycharm的 中, 如图: 即可. 阅读全文
posted @ 2017-11-20 19:26 默盒 阅读(1324) 评论(0) 推荐(0) 编辑
摘要: ```python3 import numpy as np import matplotlib.pyplot as plt def kmeans(data, cluster_num, method='mean'): points = np.array(data) labels = [] random 阅读全文
posted @ 2017-11-20 14:27 默盒 阅读(1350) 评论(0) 推荐(1) 编辑
摘要: ```python3 img_gray = cv2.imread(r"./example.png", 0) the threshold you want is thr thr = 127 bw = ((img_gray / (thr 2)) 0.5).astype(np.uint8) 255 INV 阅读全文
posted @ 2017-11-19 15:23 默盒 阅读(334) 评论(0) 推荐(0) 编辑
摘要: [参考1:] 问题: 多半是session用毕没有及时close, 导致系统和GPU的很大部分被占用过却没有归还, 当前资源便不够了; 或是多个session争用GPU. 解决: 在每次测试想运行的session前加上: 当然最好还是尽可能使用上下文管理器吧, 不适合用的地方记得手动close(). 阅读全文
posted @ 2017-11-15 09:23 默盒 阅读(7809) 评论(2) 推荐(1) 编辑
摘要: 成因: 未给系统指定相应使用的GPU 解决: 1. 层面1: 针对单个程序: 3. 层面2: 针对各个虚拟环境: 修改 , 在末尾添加行 即可. 4. 层面3: 针对系统用户: 同上修改 即可. 1. 至于set成0还是1, ·watch nvidia smi·查看下显卡的序号即可. 阅读全文
posted @ 2017-11-14 16:47 默盒 阅读(6345) 评论(0) 推荐(0) 编辑