- 博客(57)
- 问答 (1)
- 收藏
- 关注
原创 RuntimeError: apex.optimizers.FusedSGD requires cuda extension
RuntimeError: apex.optimizers.FusedSGD requires cuda extension
2022-12-05 15:24:40
1998
原创 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
1003
原创 jinja2.exceptions.UndefinedError: ‘forms.ContactForm object‘ has no attribute ‘hidden_tag‘
把contact.html的{{form.hidden_tag()}}的()去掉。
2022-10-28 12:00:26
609
原创 jinja2.exceptions.UndefinedError: ‘forms.ContactForm object‘ has no attribute ‘hidden_tag‘
把contact.html的{{form.hidden_tag()}}的()去掉。
2022-07-21 11:25:51
705
原创 python 切片 下标 列表
定义一个2x3的二维数组,使用切片方法获取子数组。 比如想获取第一维的所有数同时第二维第二个和第三个数得到2x2的数组[[2,3],[5,6]]
2022-05-19 17:22:15
289
原创 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
1034
原创 python 运算符 // % / **
参考链接:https://www.runoob.com/python/python-operators.html //:取整除,返回商的余数部分(向下取整) 5//4 = 1 5//(-4) = -2 %:取模,返回除法的余数 /:除 **:返回x 的y次幂(x=5,y=4)
2022-05-19 11:15:06
423
原创 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
407
原创 python 两个list相加 /extend
+与extend区别 相同点:"+"和"extend"都能将两个列表成员拼接到到一起 不同点: + : 生成的是一个新列表(id改变) extend : 是将一个列表的成员一个个取出添加到原列表中 , 改变的是原列表的值 , id不变 总结:+ 会产生一个新的内存来接收拼接结果,extend不会产生新的内存,直接在原始的c.extend(b)----直接在c的基础上操作,不产生新内存,推荐使用,以节约内存空间 原文链接:https://blog.youkuaiyun.com/nbxuwentao/article/de.
2022-05-18 14:52:38
1407
1
原创 windows junction创建软链接
junction工具下载链接 https://docs.microsoft.com/zh-cn/sysinternals/downloads/junction 解压到 C:\Windows\System32 创建软链接步骤: 1.首先在cmd输入C:\Windows\System32\junction.exe 2.有一个弹窗出现,点击agree 3.然后创建软链接,命令: junction 目标地址 源地址 ...
2022-04-08 10:50:56
676
原创 numpy.maximum
逐元素比较两个数组(标量)的最大值 https://numpy.org/doc/stable/reference/generated/numpy.maximum.html numpy.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
1674
原创 python __getitem__
参考链接 https://blog.youkuaiyun.com/qq_24805141/article/details/81411775 https://zhuanlan.zhihu.com/p/27661382 https://www.cnblogs.com/Aiyuqianer/p/14091062.html __getitem__是一种特殊方法(魔术方法),能让对象具有迭代功能。 class DataBase: '''Python 3 中的类''' def __init__(self, id,
2022-04-07 10:22:03
995
原创 python类的特殊方法-自动调用
参考链接 https://cloud.tencent.com/developer/article/1749007
2022-04-06 09:45:00
649
原创 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
1337
原创 tf.placeholder
https://blog.youkuaiyun.com/TeFuirnever/article/details/88928871
2022-01-24 15:38:10
206
原创 解决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
1043
原创 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
890
原创 tensorflow_examples下载失败
pip install --upgrade setuptools pip install git+git://github.com/tensorflow/examples.git
2021-12-22 14:44:16
990
原创 无重复字符的最长子串 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/ 题目 method class Solution: def lengthOfLongestSubstring(self, s: str) -> int: if not s:ret
2021-12-08 15:12:14
3929
原创 明明的随机数
my method n = 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
124
原创 计算某字符出现次数
my method a = input() b = input() n = 0 for i in range(len(a)): b1 = b.lower() a1 = a[i].lower() c = a1==b1 if c: n = n+1 print(n) 别人的 count()方法用于统计字符串里某个字符或字符串出现的次数 总结: 内置方法强呀 ...
2021-12-07 17:05:21
229
原创 华为即使题库 字符串最后一个单词的长度
我的方法是 讨论区的 a = input().split(’ ') print(len(a[-1])) 使用split方法,以空格为分隔符,将原来的字符串分割成几个子字符串,a[-1]为最后一个子字符串
2021-12-07 16:52:18
100
原创 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
271
原创 tf.RaggedTensor
吐槽:看了半天看懂一点 官网链接:https://tensorflow.google.cn/api_docs/python/tf/RaggedTensor 参考博文:https://blog.youkuaiyun.com/jackhh1/article/details/102690290 ragged是不规则的意思 raggedtensor是不规则的张量 没有学习整个文档,对学习到的陈述。 举例 原来的tensor是[3, 1, 4, 1, 5, 9, 2, 6] row_splits是切分下标。从row_split
2021-12-07 11:09:21
1447
原创 python .rjust()函数解析
.rjust()函数返回一个原字符串右对齐,并使用空格填充至长度width的新字符串。如果指定的长度小于字符串的长度则返回原字符串。 r :right 右 just:justify 对齐 用法: str.rjust(width[, fillchar]) 其中 width指定填充指定字符后中字符串的总长度 fillchar 填充的字符,default为空格(fill 填充 char 字符) ...
2021-12-07 10:00:40
3153
1
原创 python all()函数应用
all()函数用于判断给定的可迭代参数iterable中的所有元素是否都为TRUE,如果是 返回TRUE,否则返回FALSE 元素为[‘0’,‘空’,‘None’,‘False’]算false,其余算True 等价于: def all(iterable): for element in iterable: if not element: return False return True 空列表/元组 返回为TRUE ...
2021-12-06 14:59:01
131
原创 numpy.mean
numpy.mean求均值 以mn矩阵为例 axis不设置值时 返回mn个数的均值,类型为实数 axis=0,压缩行,对各列求均值,返回1n的矩阵 axis=1,压缩列,对各行求均值,返回m1的矩阵
2021-12-06 14:58:40
107
原创 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
4146
原创 numpy.vstack
v是vertically(垂直的意思),在垂直方向推叠 官方链接 https://numpy.org/doc/stable/reference/generated/numpy.vstack.html
2021-12-02 15:43:30
3347
原创 numpy.sum的用法
axis=1时 按列压缩 (输出为行向量) axis=0时 按行压缩(输出为行向量) 参考链接 https://blog.youkuaiyun.com/leekingsen/article/details/76242244
2021-12-02 10:11:43
1471
空空如也
chatgpt4值得购买吗
2024-12-02
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅