python
REALLYAI
record
展开
-
RuntimeError: apex.optimizers.FusedSGD requires cuda extension
RuntimeError: apex.optimizers.FusedSGD requires cuda extension原创 2022-12-05 15:24:40 · 1595 阅读 · 1 评论 -
tf.stack解析
tf.stack解析原创 2022-11-11 11:35:34 · 368 阅读 · 0 评论 -
tf.shape解析
tf.shape解析原创 2022-11-11 11:14:46 · 386 阅读 · 0 评论 -
tf.pad解析(参考官方文档)
tf.pad解释原创 2022-11-10 17:44:33 · 402 阅读 · 0 评论 -
Your connection is not private Attackers might be trying to steal your information from nemertes.lis
Your connection is not private Attackers might be trying to steal your information from nemertes.lis原创 2022-11-10 16:40:38 · 674 阅读 · 0 评论 -
jinja2.exceptions.UndefinedError: ‘forms.ContactForm object‘ has no attribute ‘hidden_tag‘
把contact.html的{{form.hidden_tag()}}的()去掉。原创 2022-10-28 12:00:26 · 486 阅读 · 0 评论 -
jinja2.exceptions.UndefinedError: ‘forms.ContactForm object‘ has no attribute ‘hidden_tag‘
把contact.html的{{form.hidden_tag()}}的()去掉。原创 2022-07-21 11:25:51 · 517 阅读 · 0 评论 -
python 切片 下标 列表
定义一个2x3的二维数组,使用切片方法获取子数组。比如想获取第一维的所有数同时第二维第二个和第三个数得到2x2的数组[[2,3],[5,6]]原创 2022-05-19 17:22:15 · 201 阅读 · 0 评论 -
python实现yolov3中图像尺寸变化
参考链接:https://zhuanlan.zhihu.com/p/49995236变化函数def letterbox_image(img, inp_dim): """ letterbox_image()将图片按照纵横比进行缩放,将空白部分用(128,128,128)填充,调整图像尺寸 具体而言,此时某个边正好可以等于目标长度,另一边小于等于目标长度 将缩放后的数据拷贝到画布中心,返回完成缩放 """ img_w, img_h = img.shape[1]原创 2022-05-19 11:46:49 · 809 阅读 · 0 评论 -
python 运算符 // % / **
参考链接:https://www.runoob.com/python/python-operators.html//:取整除,返回商的余数部分(向下取整)5//4 = 15//(-4) = -2%:取模,返回除法的余数/:除**:返回x 的y次幂(x=5,y=4)原创 2022-05-19 11:15:06 · 292 阅读 · 0 评论 -
numpy.full
numpy.full(shape, fill_value, dtype=None, order=‘C’, *, like=None)Return a new array of given shape and type, filled with fill_value.shape:生成数组的形状fill_value:填充的值返回一个形状为指定shape和类型的数组参考链接:https://numpy.org/doc/stable/reference/generated/numpy.full.html.原创 2022-05-19 11:01:30 · 297 阅读 · 0 评论 -
python 两个list相加 /extend
+与extend区别相同点:"+"和"extend"都能将两个列表成员拼接到到一起不同点: + : 生成的是一个新列表(id改变)extend : 是将一个列表的成员一个个取出添加到原列表中 , 改变的是原列表的值 , id不变总结:+ 会产生一个新的内存来接收拼接结果,extend不会产生新的内存,直接在原始的c.extend(b)----直接在c的基础上操作,不产生新内存,推荐使用,以节约内存空间原文链接:https://blog.csdn.net/nbxuwentao/article/de.原创 2022-05-18 14:52:38 · 1221 阅读 · 1 评论 -
windows junction创建软链接
junction工具下载链接https://docs.microsoft.com/zh-cn/sysinternals/downloads/junction解压到 C:\Windows\System32创建软链接步骤:1.首先在cmd输入C:\Windows\System32\junction.exe2.有一个弹窗出现,点击agree3.然后创建软链接,命令:junction 目标地址 源地址...原创 2022-04-08 10:50:56 · 405 阅读 · 0 评论 -
numpy.maximum
逐元素比较两个数组(标量)的最大值https://numpy.org/doc/stable/reference/generated/numpy.maximum.htmlnumpy.maximum(x1, x2, /, out=None, *, where=True, casting=‘same_kind’, order=‘K’, dtype=None, subok=True[, signature, extobj]) = <ufunc ‘maximum’>¶...原创 2022-04-07 16:14:02 · 1580 阅读 · 0 评论 -
python __getitem__
参考链接https://blog.csdn.net/qq_24805141/article/details/81411775https://zhuanlan.zhihu.com/p/27661382https://www.cnblogs.com/Aiyuqianer/p/14091062.html__getitem__是一种特殊方法(魔术方法),能让对象具有迭代功能。class DataBase: '''Python 3 中的类''' def __init__(self, id,原创 2022-04-07 10:22:03 · 866 阅读 · 0 评论 -
python long函数
python .long()原创 2022-04-07 10:01:31 · 1346 阅读 · 0 评论 -
python.get方法
原创 2022-04-06 10:10:30 · 321 阅读 · 0 评论 -
python类的特殊方法-自动调用
参考链接https://cloud.tencent.com/developer/article/1749007原创 2022-04-06 09:45:00 · 545 阅读 · 0 评论 -
python web开发书籍推荐
记录下选书历程。京东明日科技的python web入门 评价还行原创 2022-03-21 10:11:15 · 854 阅读 · 0 评论 -
tf.nn.dropout
More precisely: With probability rate elements of x are set to 0. The remaining elements are scaled up by 1.0 / (1 - rate), so that the expected value is preserved.https://www.tensorflow.org/api_docs/python/tf/nn/dropout原创 2022-01-25 11:28:57 · 1269 阅读 · 0 评论 -
tf.nn.conv3d
https://www.tensorflow.org/api_docs/python/tf/nn/conv3d原创 2022-01-24 17:48:26 · 923 阅读 · 0 评论 -
tf.sqrt
https://www.tensorflow.org/api_docs/python/tf/math/sqrt原创 2022-01-24 16:16:30 · 1260 阅读 · 0 评论 -
tf.placeholder
https://blog.csdn.net/TeFuirnever/article/details/88928871原创 2022-01-24 15:38:10 · 156 阅读 · 0 评论 -
解决H5py的DLL问题:from . import h5 as _h5
pip uninstall h5py在官网上找到对应的h5py包https://pypi.org/project/h5py/2.10.0/#files然后pip3 install E:\download_jxs\h5py-2.10.0-cp38-cp38-win_amd64.whl原创 2021-12-30 18:29:25 · 908 阅读 · 0 评论 -
Cannot open D:\SoftWare\Anaconda\envs\transformer\Scripts\pip-script.py
检查D:\SoftWare\Anaconda\envs\transformer\Scripts\是否有pip-script.py,没有在网上找一个拷贝到D:\SoftWare\Anaconda\envs\transformer\Scripts\原创 2021-12-30 18:27:21 · 825 阅读 · 0 评论 -
tensorflow_examples下载失败
pip install --upgrade setuptoolspip install git+git://github.com/tensorflow/examples.git原创 2021-12-22 14:44:16 · 857 阅读 · 0 评论 -
无重复字符的最长子串 leetcode
官方解题link:https://leetcode-cn.com/problems/longest-substring-without-repeating-characters/solution/wu-zhong-fu-zi-fu-de-zui-chang-zi-chuan-by-leetc-2/题目methodclass Solution: def lengthOfLongestSubstring(self, s: str) -> int: if not s:ret原创 2021-12-08 15:12:14 · 3711 阅读 · 0 评论 -
明明的随机数
my methodn = int(input())n1 = []for _ in range(n): n2 = int(input()) n1.append(n2)n1 = sorted(list(set(n1)))for item in n1: print(item)m = int(input())m1 = []for _ in range(m): m2 = int(input()) m1.append(m2)m1 = sorted(lis.原创 2021-12-07 18:01:26 · 61 阅读 · 0 评论 -
计算某字符出现次数
my methoda = input()b = input()n = 0for i in range(len(a)): b1 = b.lower() a1 = a[i].lower() c = a1==b1 if c: n = n+1print(n) 别人的count()方法用于统计字符串里某个字符或字符串出现的次数总结:内置方法强呀...原创 2021-12-07 17:05:21 · 156 阅读 · 0 评论 -
华为即使题库 字符串最后一个单词的长度
我的方法是讨论区的a = input().split(’ ')print(len(a[-1]))使用split方法,以空格为分隔符,将原来的字符串分割成几个子字符串,a[-1]为最后一个子字符串原创 2021-12-07 16:52:18 · 48 阅读 · 0 评论 -
word embedding tf2.7
官网教程:https://tensorflow.google.cn/text/guide/word_embeddings独热编码作为第一个想法,您可以对词汇表中的每个单词进行“one-hot”编码。比如下面的句子 “The cat sat on the mat”.这个句子中的词库是(cat, mat, on,sat, the ).为了表示每个单词,需要创建跟词库长度一样的零向量,然后在对应单词的下标处置1.如下所示创建长度为5的零向量[0, 0, 0, 0, 0].[1, 0, 0, 0, 0]表示原创 2021-12-07 16:08:31 · 198 阅读 · 0 评论 -
tf.RaggedTensor
吐槽:看了半天看懂一点官网链接:https://tensorflow.google.cn/api_docs/python/tf/RaggedTensor参考博文:https://blog.csdn.net/jackhh1/article/details/102690290ragged是不规则的意思raggedtensor是不规则的张量没有学习整个文档,对学习到的陈述。举例原来的tensor是[3, 1, 4, 1, 5, 9, 2, 6] row_splits是切分下标。从row_split原创 2021-12-07 11:09:21 · 1190 阅读 · 0 评论 -
python .rjust()函数解析
.rjust()函数返回一个原字符串右对齐,并使用空格填充至长度width的新字符串。如果指定的长度小于字符串的长度则返回原字符串。r :right 右just:justify 对齐用法:str.rjust(width[, fillchar])其中 width指定填充指定字符后中字符串的总长度fillchar 填充的字符,default为空格(fill 填充 char 字符)...原创 2021-12-07 10:00:40 · 2741 阅读 · 1 评论 -
python all()函数应用
all()函数用于判断给定的可迭代参数iterable中的所有元素是否都为TRUE,如果是 返回TRUE,否则返回FALSE 元素为[‘0’,‘空’,‘None’,‘False’]算false,其余算True等价于:def all(iterable):for element in iterable:if not element:return Falsereturn True空列表/元组 返回为TRUE...原创 2021-12-06 14:59:01 · 74 阅读 · 0 评论 -
numpy.mean
numpy.mean求均值以mn矩阵为例axis不设置值时 返回mn个数的均值,类型为实数axis=0,压缩行,对各列求均值,返回1n的矩阵axis=1,压缩列,对各行求均值,返回m1的矩阵原创 2021-12-06 14:58:40 · 51 阅读 · 0 评论 -
indexes与indices区别
indexes与indices均为index的复数形式。“Indices” is originally a Latin plural, while “Indexes” has taken the English way of making plurals, using –s or –es. Though both are still widely used, they take on different usage in their senses. “Indices” is used when refer原创 2021-12-06 14:24:58 · 3161 阅读 · 0 评论 -
numpy.vstack
v是vertically(垂直的意思),在垂直方向推叠官方链接https://numpy.org/doc/stable/reference/generated/numpy.vstack.html原创 2021-12-02 15:43:30 · 3218 阅读 · 0 评论 -
np.ma.array解析
其中mask为1时 遮掩,比如将x展开下标为0,2,4,6,8时保持原值,其余–原创 2021-12-02 10:15:34 · 299 阅读 · 0 评论 -
numpy.sum的用法
axis=1时 按列压缩 (输出为行向量)axis=0时 按行压缩(输出为行向量)参考链接https://blog.csdn.net/leekingsen/article/details/76242244原创 2021-12-02 10:11:43 · 1418 阅读 · 0 评论 -
numpy.argmax的用法
numpy.argmax返回数组最大值的下标注意 下标为4的6也是最大值 但只返回第一个最大值的下标原创 2021-11-30 17:55:08 · 540 阅读 · 0 评论