获取nvidia-smi关于显存存利用率、GPU利用率定义的命令:nvidia-smi --help-query-gpu | grep memory
幸福的人有相似的幸福,不幸的人各有各的不幸
我提供举手之劳,而非某人的保姆。
这样,少年,如果你心中涌动着与某人欢乐、尴尬、气愤、感伤的感情,说明你和他产生着联系
跟遇见的认识的人的交流只剩下打招呼,让我觉得甚至有时打招呼徒具形式,耳不听四方,眼不见八路,心中毫无交往的痕迹
将不支持硬解码的图片转成支持硬解码的图片
ffmpeg -i a.jpg -s 28x28 -pix_fmt yuvj420p a.yuv ffmpeg -s 28x28 -i a.yuv a_supportHardDec.jpg
高版本gcc编译器cmake编译时报错:/usr/bin/ld: xx.a(xxx.o): relocation R_X86_64_32S against xxxx can not be used when making a PIE; recompile with -fPIC但共享库无法重编译,使用SET(CMAKE_EXE_LINKER_FLAGS "-no-pie")关闭位置无关代码的要求。参考链接:Resolve “`.rodata' can not be used when making a PIE object; recompile with -fPIC”
因为卸载python搞崩系统,没有桌面,执行下述步骤恢复桌面:sudo apt-get autoremove; sudo apt-get install ubuntu-desktop
N卡的id序号以nvidia-smi查询的PCI ID为准:export CUDA_DEVICE_ORDER="PCI_BUS_ID",添加该环境变量到.bashrc文件中生效,注意docker环境有其.bashrc文件
设置N卡的初始频率nvidia-smi -i gpu-id -ac mem-frequency,sm-frequency
tf版本1.14,借鉴TF 1.x: remove the "deprecated" warning messages #27023的意见无效果,别人说如下写代码有用。
import tensorflow as tf os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' tf.compat.v1.logging.set_verbosity(tf.compat.v1.logging.ERROR)
报错信息:TypeError: expected str, bytes or os.PathLike object, not int,解决办法:pip install package --no-cache-dir,报错的路径是缓存路径,pip设置缓存路径为1。参考自pip安装python依赖项时,出现错误:TypeError: expected str, bytes or os.PathLike object, not int
curl ipinfo.io
In incoming new year, practice writing, either Chinese or English, either analysis or imagination, either realtime or record.
gradient of \(f(x)\), i.e. \(\nabla_xf(x)=[{\partial f(x)\over\partial x_1}, {\partial f(x)\over\partial x_2}, \cdots, {\partial f(x)\over\partial x_n}]\), abbr. \(\nabla f(x)\)
For n-dimension vector \(x\): for \(A\in R^{m\times n}\), \(\nabla_xAx=A^T\); for \(A\in R^{n\times m}\), \(\nabla_xx^TA=A\); for \(A\in R^{n\times n}\), \(\nabla_xx^TAx=(A+A^T)x\); \(\nabla_x\left|\left|x\right|\right|^2=\nabla_xx^Tx=2x\)
For maxtrix \(X\), \(\nabla_x\left|\left|X\right|\right|_F^2=2X\)
training data, loss function, optimization algrithm and model self, referenced from d2l linear regression brief summary
A dataset has 1000 data item. I set batch size = 10, then in one epoch, I have to train in 100 iterations, referenced from 快速搞定 epoch, batch, iteration
Library Genesis z-library, referenced from Z-Library 最强电子书白嫖网 and 下载外文图书(Library Genesis)教程,后来又总结了电子书站点,见电子书下载站点
use ffprobe, a component of ffmpeg to get properties of video as follows:ffprobe -show_format video.mp4, referenced from使用FFmpeg查看媒体文件的格式信息
tar cvf dir.tar dir/, when they are files, tar cvf files.tar file1 file2
工具的在手性和上手性暗示工具在身边当即可用,不过在手性表示在手上,能够感受到,上手性表示手用起来熟练,甚至令人不觉得在手上,如庖丁解牛“方今之时,臣以神遇而不以目视,官知止而神欲行”。上手表达人与工具高度融合的状态,工具仿佛抽身而去,让使用者直接面对世界。参考链接:【工具概念】海德格尔之“上手性”、“在手性”
msys64 and cygwin64 don't have g++ command though they're sub-projects of mingw-w64. As for MinGW-w4 self, it does. I downloaded a online installer but it told that "the file has been downloaded incorrectly" with whicherver bunch of options I made. So I find a offline package to set up g++ command. References: win10 codeblocks安装mingw-w64时出现the file has been downloaded incorrectly问题解决 and 在 Windows 上安装新版本 gcc/g++
sci-hub.ru sci-hub.se sci-hub.st
鉴于我使用CUDA10.1,从CUDA与tensorflow编译版本对应表可知我需要在python3.6-3.8环境下安装tensorflow-gpu2.3.0,安装好后通过tf.test.is_gpu_available()测试tf-gpu的可用性
find dir -exec basename {} \;>ls.txt
while read file
do
echo $file
done <ls.txt,参考自how to get filename from directory
URI是标识符,URL是定位符,URI标识资源并不描述或暗示怎么定位资源。URL是URI的子集。URI被用来标识和区分HTML、XML和其他文件,URL被用来标识和定位网页。参考自URI vs. URL: What’s the Difference?
Linux不自带getopt命令,但发行版一般装有该命令。参数:-a表示长参数可以用一条短横线起头,-o表示后面是短参数参数名,-l/--long表示后面是长参数参数名,--表示后面是要被解析的命令参数字符串。参数名后面跟一个冒号表示参数需要一个值,跟两个冒号表示参数后面的值可有可无,没有冒号表示参数后面不接值,参考链接:Python getOpt参数
getopt 命令
学校只在路的一侧铺设路灯,路一边的灯亮了,整条路就亮了。我窗边的路灯坏了,希望快点修好它,这样我晚上一出门就能感受到光亮,而不是黑山洞。晚上有它陪着,我睡得也香。
C++的map底层是红黑树,有序的平衡二叉树,节点需要额外的红黑等属性信息,查找、删除、插入时间复杂度为O(logn),最坏情况下的操作次数也很稳定;unordered_map底层是哈希表,哈希表最开始建立的时候比较耗时间,且空间利用率较低,查询速度快,其他操作应该也快。java的Hashtable和HashMap的底层实现都是数组+链表+红黑树,JDK8规定若链表长度大于8则转换为红黑树,Java已弃用Hashtable,可用并发时保证线程安全的ConcurrentHashMap或简单快速但不保证线程安全的HashMap。参考链接:Java之HashMap、Hashtable、LinkedHashMap、TreeMap、ConcurrentHashMap简单的区别 、map和unordered_map的区别
本文创建于2021年10月18日14点50分,修改于2022.4.2/21.13