Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问有没有详细的使用手册,数据集路径啥的是和mmdetection一样的么,本人小白,看到大佬的框架非常佩服,非常感谢 #1

Closed
hu-wei-carrzy opened this issue Apr 4, 2023 · 28 comments

Comments

@hu-wei-carrzy
Copy link

No description provided.

@Xuyihaoby
Copy link
Owner

是的,数据路径都是差不多的。基本上就是基于mmedetection修改出来的。

@hu-wei-carrzy
Copy link
Author

hu-wei-carrzy commented Apr 4, 2023 via email

@Xuyihaoby
Copy link
Owner

方便提供相关导入报错信息吗?

@hu-wei-carrzy
Copy link
Author

hu-wei-carrzy commented Apr 4, 2023 via email

@Xuyihaoby
Copy link
Owner

是否有运行以下命令去编译算子 pip install -v -e . # or "python setup.py develop"?

@hu-wei-carrzy
Copy link
Author

有运行命令python setup.py develop

@Xuyihaoby
Copy link
Owner

成功编译了?

@hu-wei-carrzy
Copy link
Author

我重头再按教程来一次

@Xuyihaoby
Copy link
Owner

没事儿,如果实在不太好编译的话,这里也更加推荐原作者版或者mmrotate,我在reference下也已经贴明链接 :)

@hu-wei-carrzy
Copy link
Author

我之前用的就是mmrotate

@hu-wei-carrzy
Copy link
Author

conda create -n hw-rotate python=3.7 -y
conda activate hw-rotate
pip install torch==1.7.0+cu110 torchvision==0.8.1+cu110 torchaudio==0.7.0 -f https://download.pytorch.org/whl/torch_stable.html
pip install mmcv-full==1.2.5 -f https://download.openmmlab.com/mmcv/dist/cu110/torch1.7.0/index.html
pip install -r requirements/build.txt
python setup.py develop

/home/giant/miniconda3/envs/hw-rotate/bin/python /media/giant/Data/WorkSpace/hw/rotate_detection-main/tools/train.py /media/giant/Data/WorkSpace/hw/rotate_detection-main/configs/ReDet/faster_rcnn_re50_refpn_1x.py /media/giant/Data/WorkSpace/hw/rotate_detection-main/workdirs/ReDet/faster_rcnn_re50_refpn_1x
Traceback (most recent call last):
File "/media/giant/Data/WorkSpace/hw/rotate_detection-main/tools/train.py", line 15, in
from mmdet.apis import set_random_seed, train_detector
File "/media/giant/Data/WorkSpace/hw/rotate_detection-main/mmdet/apis/init.py", line 1, in
from .inference import (async_inference_detector, inference_detector,
File "/media/giant/Data/WorkSpace/hw/rotate_detection-main/mmdet/apis/inference.py", line 11, in
from mmdet.datasets import replace_ImageToTensor
File "/media/giant/Data/WorkSpace/hw/rotate_detection-main/mmdet/datasets/init.py", line 2, in
from .cityscapes import CityscapesDataset
File "/media/giant/Data/WorkSpace/hw/rotate_detection-main/mmdet/datasets/cityscapes.py", line 16, in
from .coco import CocoDataset
File "/media/giant/Data/WorkSpace/hw/rotate_detection-main/mmdet/datasets/coco.py", line 21, in
assert pycocotools.version >= '12.0.2'
AttributeError: module 'pycocotools' has no attribute 'version'

我尝试 pip install pycocotools==12.0.2 都没有这个版本

@hu-wei-carrzy
Copy link
Author

实在抱歉,又来打扰了

@Xuyihaoby
Copy link
Owner

你可以尝试搜索一下,有些可能是mmdetection之前遗留下来的问题;以下是我搜到的结果open-mmlab/mmdetection#3761

@hu-wei-carrzy
Copy link
Author

是的我也找到了,又有新的缺包,了我的天

@hu-wei-carrzy
Copy link
Author

/home/giant/miniconda3/envs/hw-rotate/bin/python /media/giant/Data/WorkSpace/hw/rotate_detection-main/tools/train.py /media/giant/Data/WorkSpace/hw/rotate_detection-main/configs/ReDet/faster_rcnn_re50_refpn_1x.py /media/giant/Data/WorkSpace/hw/rotate_detection-main/workdirs/ReDet/faster_rcnn_re50_refpn_1x
Traceback (most recent call last):
File "/home/giant/miniconda3/envs/hw-rotate/lib/python3.7/site-packages/cupy/init.py", line 16, in
from cupy import _core # NOQA
File "/home/giant/miniconda3/envs/hw-rotate/lib/python3.7/site-packages/cupy/_core/init.py", line 1, in
from cupy._core import core # NOQA
ImportError: libcudart.so.10.1: cannot open shared object file: No such file or directory

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/media/giant/Data/WorkSpace/hw/rotate_detection-main/tools/train.py", line 15, in
from mmdet.apis import set_random_seed, train_detector
File "/media/giant/Data/WorkSpace/hw/rotate_detection-main/mmdet/apis/init.py", line 1, in
from .inference import (async_inference_detector, inference_detector,
File "/media/giant/Data/WorkSpace/hw/rotate_detection-main/mmdet/apis/inference.py", line 11, in
from mmdet.datasets import replace_ImageToTensor
File "/media/giant/Data/WorkSpace/hw/rotate_detection-main/mmdet/datasets/init.py", line 16, in
from .dotav1 import DOTADatasetV1
File "/media/giant/Data/WorkSpace/hw/rotate_detection-main/mmdet/datasets/dotav1.py", line 13, in
from ..models.utils import transXyxyxyxy2Xyxy
File "/media/giant/Data/WorkSpace/hw/rotate_detection-main/mmdet/models/init.py", line 1, in
from .backbones import * # noqa: F401,F403
File "/media/giant/Data/WorkSpace/hw/rotate_detection-main/mmdet/models/backbones/init.py", line 32, in
from .involution import RedNet
File "/media/giant/Data/WorkSpace/hw/rotate_detection-main/mmdet/models/backbones/involution.py", line 8, in
from ..utils.involution_cuda import involution
File "/media/giant/Data/WorkSpace/hw/rotate_detection-main/mmdet/models/utils/involution_cuda.py", line 9, in
import cupy
File "/home/giant/miniconda3/envs/hw-rotate/lib/python3.7/site-packages/cupy/init.py", line 37, in
raise ImportError(_msg) from e
ImportError: CuPy is not correctly installed.

If you are using wheel distribution (cupy-cudaXX), make sure that the version of CuPy you installed matches with the version of CUDA on your host.
Also, confirm that only one CuPy package is installed:
$ pip freeze

If you are building CuPy from source, please check your environment, uninstall CuPy and reinstall it with:
$ pip install cupy --no-cache-dir -vvvv

Check the Installation Guide for details:
https://docs.cupy.dev/en/latest/install.html

original error: libcudart.so.10.1: cannot open shared object file: No such file or directory

Process finished with exit code 1

在build.txt中cupy-cuda101 # note: depend on cuda version,是这个的·原因吗

@Xuyihaoby
Copy link
Owner

是的 你可以选择安装正确的cupy 或者直接在框架下把使用这个包的代码以及相关文件屏蔽

@hu-wei-carrzy
Copy link
Author

pip install torch==1.7.0+cu110 torchvision==0.8.1+cu110 torchaudio==0.7.0 -f

我下载的是cupy-cuda110,但是还是这个报错

@Xuyihaoby
Copy link
Owner

这个可能需要你自己根据报错情况进行相关调整了

@hu-wei-carrzy
Copy link
Author

好像配好了,没有导入报错,也可以生成workdirs了,数据集格式好像不太对报错 0.0,今天真是麻烦大哥了

@hu-wei-carrzy
Copy link
Author

请问我训练之后,提交到dota官网,报错。我之前在mmrotate生成的可以提交成功。
1E551F7A148D841C5DF1008C97E4C750

好像区别就是图片名称

请问是没有切割test数据集么

@hu-wei-carrzy
Copy link
Author

我使用
image
但是 没有切割test数据集,这是提交的结果
image
请问是要怎么操作额

@hu-wei-carrzy
Copy link
Author

total_epochs=12
evaluation = dict(interval=24, metric='bbox')
我改成
evaluation = dict(interval=1, metric='mAP')
没有效果,没有每轮训练输出mAP,要怎么才能看到每轮的训练效果呀
麻烦您了。

@Xuyihaoby
Copy link
Owner

在这里生成文件的步骤是分开的,test数据集是切割之后检测再合并的;关于每轮的eval,由于训练效率原因直接将其flag设置为了False,所以这么改是没有效果的。这个框架不像mmrotate那么容易上手,更多的是我自己的一些记录,有些问题可能需要自己阅读源码进行相应的修改:)

@hu-wei-carrzy
Copy link
Author

#python tools/test.py configs/oriented_rcnn/oriented_rcnn_r50_fpn_1x.py workdirs/oriented_rcnn/oriented_rcnn_r50_fpn_1x/latest.pth --format-only --eval-options submission_dir=workdirs/oriented_rcnn/Task1_results
这是我用的命令,您说的步骤是分开的要怎么操作额,合并要怎么合并额,打扰您了。

@hu-wei-carrzy
Copy link
Author

还有就是怎么设置才能看到每轮的eval,我好像没有找到您说的将flag设置为了False,麻烦您了。

@Xuyihaoby
Copy link
Owner

测试集同样需要使用DOTA-devkit进行切割,输出使用test输出pkl文件后,利用parse results进行后处理,具体可以参考[https://github.com/csuhan/ReDet];在train中把eval默认参数进行修改,之后如若出现一些bug,你可以深入源码尝试自行修改。

@hu-wei-carrzy
Copy link
Author

在trian.py中修改eval的默认参数,是train_detector中的validate么我修改为true后,在每轮训练的时候就卡在那里不动了
01879445DCCE466ACF1A835E15F50D74
374E287CC39E9FFD669E4485B8B95B21
实在不好意思,尝试了一晚上没有效果,又得打扰一下您了

@Xuyihaoby
Copy link
Owner

在线训练验证确实有可能遇到这样的问题,你可以选择自行更深入的修改,或者离线通过保存每一轮的epoch进行离线验证。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants