python
吴春旭呀
为天地立心,为生民立命,为往圣继绝学,为万世开太平
展开
-
python读取上一级文件夹下的图片
import os#path=os.path.abspath('.') #获取当前目录path1=os.path.abspath('..')#获取上一级目录# myimg = mpimg.imread('C:\\Users\\NEVERGUVEIP\\Desktop\\下载\\随书资源\\素材与样本\\实例1\\img.jpg') # 读取绝对路径下的图片# myimg = mpi...原创 2018-07-20 14:48:56 · 1437 阅读 · 0 评论 -
opencv4.10不能使用sift = cv2.xfeatures2d.SIFT_create()
python3.6报错:error: (-213:The function/feature is not implemented) This algorithm is patented and is excluded in this configuration; Set OPENCV_ENABLE_NONFREE CMake option and rebuild the library i...原创 2019-07-09 17:31:44 · 7257 阅读 · 1 评论 -
python PIL 打开\显示\保存图像
转自:https://www.cnblogs.com/denny402/p/5096001.html使用python进行数字图片处理,还得安装Pillow包。虽然python里面自带一个PIL(python images library), 但这个库现在已经停止更新了,所以使用Pillow, 它是由PIL发展而来的。pip install Pillow一、图片的打开与显示fro...转载 2019-05-12 18:55:02 · 39876 阅读 · 2 评论 -
树莓派上传数据到onenet云平台
背景:通过树莓派上传数据到onenet云平台操作:看代码# -*- coding:utf-8 -*-# File: cputemp.py#向平台已经创建的数据流发送数据点import urllib2import jsonimport timeimport datetimeAPIKEY = 'McYMwUV1DOmAC3Medopje1S0=' #改成你的APIKEY...原创 2019-05-16 14:37:03 · 6910 阅读 · 3 评论 -
python中单斜杆和双斜杠的区别
参考: https://stackoverflow.com/questions/1535596/what-is-the-reason-for-having-in-python原创 2018-08-04 15:37:27 · 3173 阅读 · 0 评论 -
成功解决Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2
原址:https://blog.csdn.net/qq_41185868/article/details/79127838 解决问题:在导入tensorflow后,进行运算时,出现了红色错误!import tensorflow as tfimport numpy as np资料参考: Advanced Vector Extensions (AVX, al...转载 2018-07-22 19:04:29 · 812 阅读 · 0 评论 -
pycharm同一目录下无法import明明已经存在的.py文件
转自:https://blog.csdn.net/l8947943/article/details/79874180亲测有用问题描述:如图:同目录下明明存在相应文件,在导入时却出现带有红色波浪线,说没有相应的模块,但是确实有random_walk文件 解决方法:在当前文件下,右键找到mark Directory as(鼠标放在文...转载 2018-07-22 16:49:13 · 34677 阅读 · 37 评论 -
JuPyter(IPython) Notebooks中使用pip安装Python的模块
问题描述:没有带GPU的电脑,搞深度学习不是耍流氓嘛,我网上看到有个云平台,免费使用了一下,小姐姐很热情。使用过程如下: 他们给的接口是Jupyter编辑平台,我就在上面跑了一个小例子。tensorflow和python环境是他们配置好的,不过我的例子中需要导入matplotlib.pylot模块。可是他们没有提供,怎么办呢?网上查了一下啊 解决方法:采用如下方法:...转载 2018-07-30 14:08:05 · 718 阅读 · 0 评论 -
tf.slice解析
tf.slice(input_, begin, size, name = None)解释 :这个函数的作用是从输入数据input中提取出一块切片 切片的尺寸是size,切片的开始位置是begin。 切片的尺寸size表示输出tensor的数据维度,其中size[i]表示在第i维度上面的元素个数。 开始位置begin表示切片相对于输入数据input_的每一个偏移量,比...转载 2018-07-29 17:06:17 · 323 阅读 · 0 评论 -
python中return和and连用
参考:stackflowreturn a and b等价于return b if a else a如果a成立返回b,否则返回a转载 2019-08-11 08:54:07 · 3227 阅读 · 1 评论