当前位置:网站首页>[fairseq] 报错:TypeError: _broadcast_coalesced(): incompatible function arguments
[fairseq] 报错:TypeError: _broadcast_coalesced(): incompatible function arguments
2022-07-03 04:06:00 【Muasci】
前言
我通过复写了模型的state_dict方法,具体就是给其增加了dynamic_mask(字典类型,里面是tensor),allocated_neuron_num(整型)。
def state_dict(self, destination=None, prefix='', keep_vars=False):
state_dict = super().state_dict(destination, prefix, keep_vars)
state_dict['model.dynamic_mask'] = gloVar.dynamic_mask
state_dict['model.allocated_neuron_num'] = gloVar.allocated_neuron_num
return state_dict
结果报错:
File "/data3/syxu/sparsenmt_exp/sparsenmt/fairseq/fairseq/models/distributed_fairseq_model.py", line 58, in DistributedFairseqModel
wrapped_model = DistributedDataParallel(
File "/data3/syxu/anaconda3/envs/torch18/lib/python3.8/site-packages/torch/nn/parallel/distributed.py", line 580, in __init__
self._sync_params_and_buffers(authoritative_rank=0)
File "/data3/syxu/anaconda3/envs/torch18/lib/python3.8/site-packages/torch/nn/parallel/distributed.py", line 597, in _sync_params_and_buffers
self._distributed_broadcast_coalesced(
File "/data3/syxu/anaconda3/envs/torch18/lib/python3.8/site-packages/torch/nn/parallel/distributed.py", line 1334, in _distributed_broadcast_coalesced
dist._broadcast_coalesced(
TypeError: _broadcast_coalesced(): incompatible function arguments. The following argument types are supported:
1. (process_group: torch._C._distributed_c10d.ProcessGroup, tensors: List[at::Tensor], buffer_size: int, src: int = 0) -> None
解决
不使用报错中显示的DistributedDataParallel。根据文档,这个在fairseq中体现为–ddp-backend参数。
报错时–ddp-backend=pytorch_ddp
(默认),改为legacy_ddp
、no_c10d
都不会再报错。
参考
https://fairseq.readthedocs.io/en/latest/command_line_tools.html
https://blog.csdn.net/j___t/article/details/104368597
边栏推荐
- Xrandr modifier la résolution et le taux de rafraîchissement
- What can learning pytorch do?
- IPv6 foundation construction experiment
- pytorch怎么下载?pytorch在哪里下载?
- MySQL timestampdiff interval
- SAP ui5 application development tutorial 105 - detailed introduction to the linkage effect implementation of SAP ui5 master detail layout mode
- Esp32 series (3): GPIO learning (take simple GPIO input and output, ADC, DAC as examples)
- Commands related to the startup of redis under Linux server (installation and configuration)
- Debug: CD cannot be used in kaggle
- Causal AI, a new paradigm for industrial upgrading of the next generation of credible AI?
猜你喜欢
The latest analysis of the main principals of hazardous chemical business units in 2022 and the simulated examination questions of the main principals of hazardous chemical business units
nodejs基础:浅聊url和querystring模块
2022 polymerization process examination questions and polymerization process examination skills
Mutex and rwmutex in golang
JMeter starts from zero (III) -- simple use of regular expressions
第十届中国云计算大会·中国站:展望未来十年科技走向
2022 mobile crane driver examination registration and mobile crane driver operation examination question bank
国产PC系统完成闭环,替代美国软硬件体系的时刻已经到来
When writing a web project, SmartUpload is used for file upload and new string () is used for transcoding, but in the database, there will still be random codes similar to poker
Arduino application development - LCD display GIF dynamic diagram
随机推荐
vim 的实用操作
Wechat applet + Alibaba IOT platform + Hezhou air724ug built with server version system analysis
Competitive product analysis and writing
Appium automated testing framework
Sklearn data preprocessing
SAP ui5 application development tutorial 105 - detailed introduction to the linkage effect implementation of SAP ui5 master detail layout mode
『期末复习』16/32位微处理器(8086)基本寄存器
[set theory] set concept and relationship (set family | set family examples | multiple sets)
leetcode:297. 二叉树的序列化与反序列化
How does the pytorch project run?
[untitled] 2022 safety production supervisor examination question bank and simulated safety production supervisor examination questions
MPLS setup experiment
树莓派如何连接WiFi
[brush questions] most elements (super water king problem)
[Blue Bridge Road -- bug free code] interpretation of some codes of matrix keyboard
The latest activation free version of Omni toolbox
[DRM] simple analysis of DRM bridge driver call process
[mathematical logic] predicate logic (first-order predicate logic formula | example)
MySQL create table
[Blue Bridge Road - bug free code] pcf8591 - code analysis of AD conversion