get_resource_path() takes 1 positional argument but 2 were given
时间: 2023-09-24 20:02:41 浏览: 32
这个错误通常表示你在调用`get_resource_path()`函数时传入了多余的参数。`get_resource_path()`函数只接受一个参数,通常是文件名或路径,用于指定资源的位置。如果你传入了多于一个参数,就会出现这个错误。
请检查你的代码,确保在调用`get_resource_path()`函数时只传入了一个参数。如果你需要使用多个参数来指定资源位置,可以考虑将它们合并为一个参数,或者重新设计你的代码逻辑以满足需求。
相关问题
get_ipython() takes 1 positional argument but 2 were given
This error occurs when you pass an argument to `get_ipython()` function, which does not accept any argument. `get_ipython()` function is used to retrieve the current IPython interpreter instance, and it does not take any argument.
Here's an example of how to use `get_ipython()` function:
```
ipython = get_ipython()
```
Make sure that you are not passing any argument to `get_ipython()` function. If you are still facing the issue, please share your code snippet so that I can assist you better.
__init__() takes 1 positional argument but 2 were given
问题的报错信息是"__init__() takes 1 positional argument but 2 were given",这个错误通常是由于在实例化类时传递了多余的参数导致的。根据引用\[1\]中的解决方法,你可以尝试在迭代训练之前实例化网络。在你的代码中,你可以添加以下代码来实例化网络:
```
net = Cnn()
```
这样就可以解决这个报错了。如果其他方法不起作用,你可以尝试这个方法。希望能帮到你!\[1\]
#### 引用[.reference_title]
- *1* [Pytorch报错TypeError : __init__() takes 1 positional argument but 2 were given 原因及解决方法](https://blog.csdn.net/weixin_40911578/article/details/125514556)[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^insert_down1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [TypeError: __init__() takes 1 positional argument but 2 were given](https://blog.csdn.net/weixin_44025103/article/details/126806468)[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^insert_down1,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]