上一页 1 2 3 4 5 6 ··· 29 下一页
摘要: torch进行GPU卡训练时,报错RuntimeError: Address already in use参考:https://www.it610.com/article/1279180977062559744.htm问题在于,TCP的端口被占用,一种解决方法是,运行程序的同时指定端口,端口号随意给 阅读全文
posted @ 2022-10-14 12:04 morein2008 阅读(1361) 评论(0) 推荐(0) 编辑
摘要: Python解析Xml from lxml import etree def get_info_from_xml(xml_text): try: parser = etree.XMLParser(recover=True) tree = etree.fromstring(bytes(xml_text 阅读全文
posted @ 2022-10-13 15:31 morein2008 阅读(31) 评论(0) 推荐(0) 编辑
摘要: 用命令即可: python3 -m torch.distributed.launch --master_port 10001 --nproc_per_node 8 train.py 其中设置master_port是为了避免端口已被其他进程占用而报错,若报错可设置一个新端口号为master_port 阅读全文
posted @ 2022-09-01 18:08 morein2008 阅读(137) 评论(0) 推荐(0) 编辑
摘要: transformers API参考链接:https://huggingface.co/docs/transformers/v4.21.2/en/training train.py from datasets import load_dataset from transformers import 阅读全文
posted @ 2022-09-01 18:02 morein2008 阅读(438) 评论(0) 推荐(0) 编辑
摘要: https://www.cnblogs.com/peghoty/p/3857839.html 阅读全文
posted @ 2022-08-23 19:18 morein2008 阅读(10) 评论(0) 推荐(0) 编辑
摘要: 参考:https://go.dev/blog/using-go-modules go mod init creates a new module, initializing the go.mod file that describes it. go build, go test, and other 阅读全文
posted @ 2022-07-22 18:38 morein2008 阅读(39) 评论(0) 推荐(0) 编辑
摘要: 参考:https://cloud.tencent.com/developer/article/1803377 使用信号量和 PV 操作实现进程的同步也非常方便,三步走: 定义一个同步信号量,并初始化为当前可用资源的数量 在优先级较「高」的操作的「后」面执行 V 操作,释放资源 在优先级较「低」的操作 阅读全文
posted @ 2022-06-12 12:21 morein2008 阅读(163) 评论(0) 推荐(0) 编辑
摘要: 参考:https://blog.csdn.net/weixin_44211968/article/details/123048160 最近在用golang改写一个模型服务接口,之前的开发人员用的echo框架,是常见的http方式,不支持多线程的方式,为了提高并发 ,想用多线程(go routine) 阅读全文
posted @ 2022-06-10 19:15 morein2008 阅读(1655) 评论(0) 推荐(0) 编辑
摘要: 在国内用go get安装golang包经常报错,很折磨人,可以采用手动安装的方式解决: 手动安装golang的第三方依赖包的步骤: 1、去github等网站下载代码库(.zip压缩包)到本地,解压之后放进GOROOT或者GOPATH下的src目录下(若GOPATH下没有src目录,可自己创建一个), 阅读全文
posted @ 2022-05-18 20:25 morein2008 阅读(1435) 评论(0) 推荐(0) 编辑
摘要: 一、channel的理解可参考:[系列] Go - chan 通道 - 新亮笔记 - 博客园 (cnblogs.com) 主要点: 1、管道类似队列:队满时,入队会导致阻塞,队空时出队也会阻塞; 不带缓冲的通道,进和出都会立刻阻塞。不带缓冲的管道类似ch:=make(chan data_type,N 阅读全文
posted @ 2022-05-12 17:29 morein2008 阅读(126) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 29 下一页