TypeError: NuScenesDataset: __init__() missing 2 required positional arguments: 'doc' and 'pos'
时间: 2023-12-25 12:06:43 浏览: 190
根据引用\[1\]中的代码,报错信息"TypeError: __init__() missing 2 required positional arguments: 'doc' and 'pos'"是因为在初始化NuScenesDataset类时缺少了两个必需的位置参数'doc'和'pos'。这意味着在创建NuScenesDataset对象时,需要提供'doc'和'pos'参数的值。
要解决这个问题,你需要在创建NuScenesDataset对象时提供'doc'和'pos'参数的值。确保在调用__init__方法时传入正确的参数。例如,可以使用以下代码创建NuScenesDataset对象:
```python
dataset = NuScenesDataset(doc, pos)
```
其中,'doc'和'pos'是你需要根据具体情况提供的参数值。请注意,这只是一个示例,你需要根据你的代码逻辑和需求来确定正确的参数值。
#### 引用[.reference_title]
- *1* [python错误:TypeError: __init__() missing 1 required positional argument: ‘n](https://blog.csdn.net/m0_51788349/article/details/118655043)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [Python成功解决TypeError: __init__() missing 1 required positional argument: ‘comment](https://blog.csdn.net/weixin_44991673/article/details/110099428)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [Python之常见报错missing 2 required positional arguments的2种问题排查方法](https://blog.csdn.net/qq_41845402/article/details/128569195)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文