python函数
大圆规家
这个作者很懒,什么都没留下…
展开
-
mac安装pillow
mac中安装pillow原创 2022-10-19 18:44:32 · 1262 阅读 · 0 评论 -
解决多卡加载预训练模型时,卡0总会比其他卡多占用显存,多卡占用显存不均
多卡训练卡0占用显存多,卡0占用显存多余其他卡原创 2022-09-07 17:44:28 · 2158 阅读 · 2 评论 -
解决docker中安装opencv-python出现的问题
'cv2' has no attribute 'gapi_wip_gst_GStreamerPipeline.ImportError: libGL.so.1: cannot open shared object file: No such file or directory原创 2022-09-07 16:06:25 · 1455 阅读 · 0 评论 -
在训练U2Net时“result type Double can‘t be cast to the desired output type Byte”
解决训练U2Net时遇到的“result type Double can't be cast to the desired output type Byte”错误原创 2022-08-12 16:39:43 · 1427 阅读 · 9 评论 -
python locals动态获取变量名
a1 = 100a2 = 200a3 = 300# 获取a2的值print(locals()['a%d'%2])结果如下:python官方文档中这样定义locals()函数:因此,可以使用字典的使用方式使用locals函数locals()['变量名']变量名中间可以使用%d、%s等占位符,然后'变量名'字符串后跟 %参数 即可调用该函数。换成format也可以。1. %s等形式2. format函数...原创 2022-03-13 23:08:51 · 1155 阅读 · 0 评论