run.py: error: unrecognized arguments: run.py
时间: 2024-05-09 20:18:38 浏览: 23
It seems like you are trying to execute the `run.py` script with the argument `run.py` which is not a valid argument.
To execute a Python script, you can use the following command in your terminal:
```
python <filename>.py
```
So, in your case, you can try running the script with the following command:
```
python run.py
```
This should execute the script without any errors.
相关问题
conda-script.py: error: unrecognized arguments: -n
根据提供的引用内容,你可以尝试以下方法来解决"conda-script.py: error: unrecognized arguments: -n"错误:
1. 检查命令行参数:错误信息表明在运行conda-script.py时出现了未识别的参数"-n"。请检查你输入的命令行参数是否正确,并确保没有拼写错误或者多余的空格。
2. 查看conda版本:确保你正在使用的是最新版本的conda。你可以通过运行以下命令来检查并更新conda:
```shell
conda update conda
```
3. 检查环境变量:确保你的环境变量配置正确。特别是检查是否正确设置了conda的路径。
4. 重新安装conda:如果以上方法都没有解决问题,你可以尝试重新安装conda。首先卸载现有的conda,然后重新下载并安装最新版本的conda。
test.py: error: unrecognized arguments: --eval mAP
如果你在运行 `test.py` 时遇到了 `unrecognized arguments: --eval mAP` 的错误,可能是因为你的 mmdetection 版本较旧,不支持 `--eval mAP` 参数。
在较老版本的 mmdetection 中,可以通过在配置文件中添加以下代码来计算 mAP@0.5、mAP@0.75 等不同阈值下的 mAP:
```
# 在配置文件中添加以下代码
evaluation = dict(
interval=1,
metric='mAP',
save_best='mAP',
max_score=1.0,
ap={
'iou_thr': 0.5
},
use_sigmoid=False,
classwise=True,
jsonfile_prefix=None,
)
```
在上述代码中,`ap` 参数指定了计算 mAP 的阈值。例如,`ap={'iou_thr': 0.5}` 表示计算 mAP@0.5,`ap={'iou_thr': 0.75}` 表示计算 mAP@0.75。
然后,在运行 `test.py` 时,不需要添加 `--eval mAP` 参数,只需要指定配置文件和权重文件即可,例如:
```
python tools/test.py <CONFIG_FILE> <CHECKPOINT_FILE>
```
运行后,会在控制台输出 mAP@0.5 等不同阈值下的 mAP 值。
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)