![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
文章平均质量分 68
blue_xinran
人工智能 视觉图像
展开
-
Python学习日记1
今天安装了Anaconda5.3,在Spyder里调试原来的hangman小程序(使用python2.7 pyqt4),在python3.7 pyqt5中略有一些兼容问题,比如print blabla要改成print(blabla),QtGui要改成QtWidgets。下面安装tensorflow,原有的www.tensorflow.org无法连接,要使用https://tensorflow.g...原创 2018-10-11 16:23:46 · 150 阅读 · 1 评论 -
python学习日记19官方教程和网站总结
python: https://docs.python.org/3.5/tutorial/数据类型说明: https://docs.python.org/3.5/tutorial/datastructures.html时间: https://docs.python.org/3.5/library/time.html文件路径和链接操作:https://docs.python.or...原创 2018-11-23 16:31:58 · 155 阅读 · 0 评论 -
学习日记17python的数据类型说明
参考官方tutorialhttps://docs.python.org/3.5/tutorial/datastructures.html原创 2018-11-22 09:10:29 · 191 阅读 · 0 评论 -
python学习日记18keras训练发生了奇怪的事情
使用train_history = model.fit(x=x_train_normalize,y=y_trainOnehot,validation_split = 0.2,epochs=10,batch_size=200,verbose=1,validation_data=(x_test_normalize,y_testOnehot))训练,因为在anaconda中,La...原创 2018-11-23 09:05:22 · 357 阅读 · 0 评论 -
python学习日记20keras学习1 model
tensorflow以keras为入门基础,教程样例第一个是fashionmnist,第二个是moviereview。首先,对数据进行预处理train_data = keras.preprocessing.sequence.pad_sequences(train_data,value=word_index[""],padding=‘post’,maxlen=256)test_data...原创 2018-11-26 10:41:38 · 242 阅读 · 0 评论 -
python学习日记21- keras学习2: 样本增强
在keras中,可以使用ImageDataGenerator来扩大样本,生成batch代码样例:import time#from tensorflow import kerasfrom tensorflow.keras.preprocessing.image import ImageDataGeneratorimport numpy as npimport scipy#随机生成7幅...原创 2018-11-28 09:26:03 · 711 阅读 · 0 评论 -
Python学习日记22-numpy数组排序搜索计数命令
https://www.numpy.org.cn/reference/routines/sort.html原创 2018-12-01 04:47:08 · 204 阅读 · 0 评论 -
Python学习日记23-PIL
PIL库, Python Imaging Library (PIL)。该库仅支持到2.7.官网http://pythonware.com/products/pil/对于python3.0以上版本,可以pip install pillow代替测试:from PIL import Imageim = Image.open(“bride.jpg”)im.rotate(45).show()...原创 2018-12-01 06:35:06 · 150 阅读 · 0 评论 -
python学习日记25matplotlib
matplotlib,是一款风格近似matlab,面向对象的画图工具包入门教程https://matplotlib.org/tutorials/introductory/usage.html#sphx-glr-tutorials-introductory-usage-py顶层top of the hierarchy,是由 matplotlib.pyplot模块提供的state-machine...原创 2018-12-08 00:50:00 · 4283 阅读 · 0 评论 -
python学习日记26MNIST中,分类结果分析,以及图像数据库中原始label错误
训练和预测代码如下model=Sequential()model.add(Dense(units=64,input_dim=784,kernel_initializer=‘normal’,activation=‘relu’))model.add(Dense(units=10,kernel_initializer=‘normal’,activation=‘softmax’))mo...原创 2018-12-08 00:53:32 · 706 阅读 · 0 评论 -
python学习日记24-keras3报错PruneForTargets: Some target nodes not found: group_deps
对于sequential类型的model,在model.fit时报错PruneForTargets: Some target nodes not found: group_deps找不到代码错误。重新启动spyder后,可以正常运行。怀疑是keras的不稳定引起。...原创 2018-12-06 02:37:33 · 1813 阅读 · 0 评论 -
python学习日记28 如何简单地理解Python中的if __name__ == '__main__'
摘要通俗的理解__name__ == ‘main’:假如你叫小明.py,在朋友眼中,你是小明(name == ‘小明’);在你自己眼中,你是你自己(name == ‘main’)。if name == 'main’的意思是:当.py文件被直接运行时,if name == 'main’之下的代码块将被运行;当.py文件以模块形式被导入时,if name == 'main’之下的代码块不被运行...转载 2019-01-11 00:40:28 · 156 阅读 · 0 评论 -
python学习日记27调试bluemoon的FashionMNIST
1安装torch2下载文件报错,由于网络问题,图像数据文件建立了,但是内容没有下载下来,改为直接拷贝到目标目录3tpj.pyline249 for batch, (image, label) in enumerate(train_loader):报错AttributeError: module ‘main’ has no attribute ‘spec’尝试修改run-&g...原创 2019-01-09 01:07:08 · 865 阅读 · 0 评论 -
windows安装G++编译器
1.验证有无安装gccwin+r 调出Run,输入cmd,调出cmd窗口输入g++ -v2安装在https://sourceforge.net/projects/mingw/下载MinGW,minimalist GUN for windowsGUN-Gun’s not unixGCC-GNU Compiler Collection在MinGW的列表中,勾选希望安装的文件包,然...原创 2019-02-16 15:52:26 · 12559 阅读 · 0 评论 -
g++编译文件并调用python
1写c++代码并编译,报错找不到include 的python.h文件找到python.h所在的目录比如:C:\ProgramData\Anaconda3\include编译时添加 -IC:\ProgramData\Anaconda3\includeg++找到了python.h...原创 2019-02-16 17:00:51 · 1883 阅读 · 0 评论 -
python学习日记13ValueError: None values not supported 查错
在修改程序添加代码时,忽然报错ValueError: None values not supported在报错的代码行查找,有某个tensor的维度错误。可以在console中,做模拟的tensor来试验sample=tf.ones([10,1],tf.float32)tf.Session().run(sample)tf.shape(tf.placeholder(tf.float32,[N...原创 2018-11-15 09:25:57 · 19197 阅读 · 0 评论 -
python学习日记12numpy与linspace
中文网站https://www.numpy.org.cn/https://www.numpy.org.cn/user_guide/quickstart_tutorial/the_basics.html#数组的创建from numpy import pinp.linspace( 0, 2, 9 ) # 9 numbers from 0 to 2array(...原创 2018-11-15 08:42:15 · 215 阅读 · 0 评论 -
python学习日记16 keras 进行Fashion MNIST分类
代码其中load_data模块看日记15import tensorflow as tffrom tensorflow import kerasimport numpy as npimport matplotlib.pyplot as pltimport load_datadef plot_image(i, predictions_array, true_label, img):pr...原创 2018-11-21 10:03:21 · 1077 阅读 · 0 评论 -
Python学习日记2 安装tensorflow
在安装tensorflow时显示no matching distribution found for tensorflow原因是tensorflow最高支持python3.5,需要在anaconda中将python3.7降版本原创 2018-10-12 07:07:55 · 1015 阅读 · 1 评论 -
Python学习日记3-第一个tensorflow程序
y=2x原创 2018-10-12 14:18:00 · 928 阅读 · 3 评论 -
python学习日记5-第二个tensorflow程序,回归y=x^2
代码import tensorflow as tfimport numpy as npimport matplotlib.pyplot as pltdef add_layer(input_holder,in_size,out_size,activation_function=None):Variable_Weight = tf.Variable(tf.random_normal([in...原创 2018-10-19 14:58:03 · 584 阅读 · 0 评论 -
python学习日记4,zip()的使用,数据类型tuple list及使用
test_X=[1,2,3,4,5]test_Y=[6,7,8,9,10]test_zipxy=zip(test_X,test_Y)print(test_zipxy)#(zipx,zipy)=zip(test_X,test_Y)#for (x,y) in zip(test_X,test_Y):for (x,y) in test_zipxy:print(x,y)&a原创 2018-10-17 10:27:24 · 1815 阅读 · 0 评论 -
python学习日记7tensorflow-手写数字分类
参考资料:1、tensorflow中文社区 mnist机器学习入门http://tensorfly.cn/tfdoc/tutorials/mnist_beginners.html2、Yann Lecun的原始网站http://yann.lecun.com/exdb/mnist/原创 2018-10-25 10:19:31 · 396 阅读 · 1 评论 -
python学习日记7tensorflow-矩阵运算
写了测试小程序import tensorflow as tfsess =tf.Session()a=tf.ones([2,3],tf.int32)print(sess.run(a))b=tf.zeros([2,3],tf.int32)print(sess.run(b))c=tf.reshape([1,2,3,4,5,6],[3,2])print(sess.run©)d=tf.m...原创 2018-10-28 16:00:27 · 211 阅读 · 0 评论 -
python学习日记六——浅拷贝 深拷贝 以及matplotlib,动态画图 设定坐标轴
浅拷贝 深拷贝:https://www.cnblogs.com/wilber2013/p/4645353.htmlmatplotlib: https://matplotlib.org/index.html原创 2018-10-21 15:49:30 · 469 阅读 · 0 评论 -
python学习日记8 tensor operator 图
#试用区分tensor和operator,操作图import tensorflow as tfimport numpy as nptf.reset_default_graph()c=tf.constant(0.0)print('cgraph: ',c.graph)g=tf.Graph()with g.as_default():c1=tf.constant(0.0)print('...原创 2018-11-02 15:57:32 · 212 阅读 · 0 评论 -
Python学习日记9 建立Github
注册Github账号,并试用。https://guides.github.com/activities/hello-world/Create and use a repositoryStart and manage a new branchMake changes to a file and push them to GitHub as commitsOpen and merge a p...原创 2018-11-05 18:42:19 · 125 阅读 · 0 评论 -
Python学习日记10 tf.reduce_家族函数
ReductionTensorFlow provides several operations that you can use to perform common math computations that reduce various dimensions of a tensor.tf.reduce_sumtf.reduce_prodtf.reduce_mintf.reduce_m...原创 2018-11-05 22:34:16 · 161 阅读 · 0 评论 -
Python学习日记14tensorboard可视化显示
将y=x^2的代码加入写log和summary然后在anaconda prompt中用d:cd codefolderactivate tensorflow进入log文件的上级目录使用命令tensorboard --log logs在chrome浏览器地址栏输入prompt给出的地址aaa:6006遗留问题:1还需要仔细阅读官方文档和教程https://tensor...原创 2018-11-15 16:04:26 · 1665 阅读 · 5 评论 -
Python学习日记11计时器
在复查y=wx+b的回归代码时,考虑到sess.run的注入机制,有时feed_dict为单个样本,有时为一批样本数据。编程试验二者的耗时,使用计时器。查找python官网,https://docs.python.org/3.5/library/time.html#time.perf_counterimport timetime.time()1542160081.5948985t...原创 2018-11-14 10:03:46 · 359 阅读 · 0 评论 -
python学习日记15 获取文件路径 URL路径及在读fashion_MNIST中的应用
参考文件链接https://docs.python.org/3.5/library/filesys.htmlhttps://docs.python.org/3.5/library/os.path.htmlhttps://docs.python.org/3.5/library/urllib.request.html?highlight=url#urllib.request.pathname2u...原创 2018-11-21 09:04:51 · 1228 阅读 · 0 评论 -
g++编译,c++调用python例子
语句调用和模块调用两种方式代码sample,部分语句python3与python2.7有所不同,本文按照python3.5编写原创 2019-02-22 10:01:55 · 735 阅读 · 0 评论