![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Pytorch
道纪书生
博士在读,国家奖学金获得者,中国机器人大赛全国亚军,研究方向:CV/SVBRDF Estimation/Object Counting/Swarm Intelligence/Evolutionary Computation,学术or技术交流欢迎私信。
展开
-
torch.mode()用法
torch.mode()用法原创 2024-03-20 16:24:36 · 574 阅读 · 0 评论 -
torchvision.transforms:同时使用RandomApply、RandomChoice,官方预处理方法、自定义预处理方法
torchvision.transforms:同时使用RandomApply、RandomChoice,官方预处理方法、自定义预处理方法原创 2022-11-07 22:13:35 · 2103 阅读 · 0 评论 -
解决:AttributeError: SyncBatchNorm is only supported within torch.nn.parallel.DistributedDataParallel
解决报错:AttributeError: SyncBatchNorm is only supported within torch.nn.parallel.DistributedDataParallel原创 2022-10-30 14:42:22 · 1041 阅读 · 0 评论 -
Python:往Json文件追加/添加数据
CSDN上已经有一些教程。例如下面这个:python:向json里面追加数据_秃头才能变得更强的博客-CSDN博客_json追加数据#1.读取原始json文件(与方式1相同)with open(fjson, 'r') as f: content = json.load(f)#2.更新字典dictaxis = {"axis":[22, 10, 11]}content.update(axis)#3.写入with open(fjson, 'a') as f_new: js原创 2022-05-06 17:39:40 · 12512 阅读 · 3 评论 -
Pytorch问题处理:Pytorch distributed RuntimeError: Address already in use
Pytorch报错如下:Pytorch distributed RuntimeError: Address already in use原因:模型多卡训练时端口被占用,换个端口就好了。解决方案:在运行命令前加上一个参数 --master_port 如: --master_port 29501后面的参数 29501 可以设置成其他任意端口注意:这个参数要加载 XXX.py前面 例如:CUDA_VISIBLE_DEVICES=2,7 python3 -m torch原创 2021-11-09 20:00:32 · 3977 阅读 · 3 评论 -
Pytorch:解决报错 No module named ‘torch.distributed.run‘
今天运行Pytorch分布式训练程序时发生了以下报错:Traceback (most recent call last): File "<stdin>", line 1, in <module>ModuleNotFoundError: No module named 'torch.distributed.run'测试后发现装的pytorch里面是有 torch.distributed模块的,当时没有torch.distributed.run原来是pyt.原创 2021-11-09 16:05:36 · 21120 阅读 · 0 评论