当前位置:网站首页>[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
边栏推荐
- Export of zip file
- ZIP文件的导出
- What is the correct way to compare ntext columns with constant values- What's the right way to compare an NTEXT column with a constant value?
- xrandr修改分辨率与刷新率
- xrandr修改分辨率與刷新率
- How to connect WiFi with raspberry pie
- 2022-07-02:以下go语言代码输出什么?A:编译错误;B:Panic;C:NaN。 package main import “fmt“ func main() { var a =
- SAP UI5 应用开发教程之一百零五 - SAP UI5 Master-Detail 布局模式的联动效果实现明细介绍
- What is pytorch? Is pytorch a software?
- Application of I2C protocol of STM32F103 (read and write EEPROM)
猜你喜欢

TCP, the heavyweight guest in tcp/ip model -- Kuige of Shangwen network

The latest activation free version of Omni toolbox

2022 tea master (intermediate) examination questions and analysis and tea master (intermediate) practical examination video

leetcode:297. Serialization and deserialization of binary tree

Nodejs Foundation: shallow chat URL and querystring module

300+ documents! This article explains the latest progress of multimodal learning based on transformer

第十届中国云计算大会·中国站:展望未来十年科技走向

Wechat applet + Alibaba IOT platform + Hezhou air724ug build a serverless IOT system (III) -- wechat applet is directly connected to Alibaba IOT platform aliiot

Nat. Comm. | 使用Tensor-cell2cell对细胞通讯进行环境感知去卷积

2022 Shandong Province safety officer C certificate examination questions and Shandong Province safety officer C certificate simulation examination question bank
随机推荐
"Designer universe" argument: Data Optimization in the design field is finally reflected in cost, safety and health | chinabrand.com org
Appium自动化测试框架
【刷题篇】 找出第 K 小的数对距离
300+篇文献!一文详解基于Transformer的多模态学习最新进展
Causal AI, a new paradigm for industrial upgrading of the next generation of credible AI?
C language hashtable/hashset library summary
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
Without sxid, suid & sgid will be in danger- Shangwen network xUP Nange
[Apple Photo Album push] IMessage group anchor local push
用户体验五要素
Dynamic programming: Longest palindrome substring and subsequence
QSAR model establishment script based on pytoch and rdkit
Debug: CD cannot be used in kaggle
中移物联网OneOS与OneNET入选《2021年物联网示范项目名单》
SAP UI5 应用开发教程之一百零五 - SAP UI5 Master-Detail 布局模式的联动效果实现明细介绍
xrandr修改分辨率與刷新率
[mathematical logic] propositional logic (judgment of the correctness of propositional logic reasoning | formal structure is eternal truth - equivalent calculus | deduction from premise - logical reas
2022 mobile crane driver examination registration and mobile crane driver operation examination question bank
Nodejs Foundation: shallow chat URL and querystring module
2022 P cylinder filling examination content and P cylinder filling practice examination video