open-mmlab / mmrotate

OpenMMLab Rotated Object Detection Toolbox and Benchmark
https://mmrotate.readthedocs.io/en/latest/
Apache License 2.0
1.88k stars 558 forks source link

[Bug] if device.type == "cpu": #978

Open ning-feng opened 10 months ago

ning-feng commented 10 months ago

Prerequisite

Task

I'm using the official example scripts/configs for the officially supported tasks/models/datasets.

Branch

master branch https://github.com/open-mmlab/mmrotate

Environment

torch 2.1.2 torchvision 0.16.2 cuda 12.1 mmcv-full 1.7.1

Reproduces the problem - code sample

.

Reproduces the problem - command or script

python tools/train.py configs/redet/redet_re50_refpn_3x_hrsc_le90.py --work-dir result --gpu-ids 0

Reproduces the problem - error message

2023-12-27 17:05:25,231 - mmrotate - INFO - workflow: [('train', 1)], max: 36 epochs 2023-12-27 17:05:25,231 - mmrotate - INFO - Checkpoints will be saved to D:\workSpace\pycharm\mmrotate-main\result by HardDiskBackend.
D:\software\anoconda\envs\mmrotate\lib\site-packages\mmcv__init.py:20: UserWarning: On January 1, 2023, MMCV will release v2.0.0, in whi ch it will remove components related to the training process and add a data transformation module. In addition, it will rename the package names mmcv to mmcv-lite and mmcv-full to mmcv. See https://github.com/open-mmlab/mmcv/blob/master/docs/en/compatibility.md for more details. warnings.warn( D:\software\anoconda\envs\mmrotate\lib\site-packages\mmcv\init__.py:20: UserWarning: On January 1, 2023, MMCV will release v2.0.0, in whi ch it will remove components related to the training process and add a data transformation module. In addition, it will rename the package names mmcv to mmcv-lite and mmcv-full to mmcv. See https://github.com/open-mmlab/mmcv/blob/master/docs/en/compatibility.md for more details. warnings.warn( Traceback (most recent call last): File "tools/train.py", line 194, in main() File "tools/train.py", line 183, in main train_detector( File "d:\workspace\pycharm\mmrotate-main\mmrotate\apis\train.py", line 144, in train_detector runner.run(data_loaders, cfg.workflow) File "D:\software\anoconda\envs\mmrotate\lib\site-packages\mmcv\runner\epoch_based_runner.py", line 136, in run epoch_runner(data_loaders[i], kwargs) File "D:\software\anoconda\envs\mmrotate\lib\site-packages\mmcv\runner\epoch_based_runner.py", line 53, in train self.run_iter(data_batch, train_mode=True, kwargs) File "D:\software\anoconda\envs\mmrotate\lib\site-packages\mmcv\runner\epoch_based_runner.py", line 31, in run_iter outputs = self.model.train_step(data_batch, self.optimizer, File "D:\software\anoconda\envs\mmrotate\lib\site-packages\mmcv\parallel\data_parallel.py", line 76, in train_step inputs, kwargs = self.scatter(inputs, kwargs, self.device_ids) streams = [_get_stream(device) for device in target_gpus] File "D:\software\anoconda\envs\mmrotate\lib\site-packages\mmcv\parallel_functions.py", line 75, in streams = [_get_stream(device) for device in target_gpus] File "D:\software\anoconda\envs\mmrotate\lib\site-packages\torch\nn\parallel_functions.py", line 117, in _get_stream if device.type == "cpu": AttributeError: 'int' object has no attribute 'type'

Additional information

我是新配置的环境第一次使用mmrotate,可能某个地方配置错误。 I'm using mmrotate for the first time in a newly configured environment, and there may be a misconfiguration somewhere.

Jimmy1456 commented 10 months ago

same issue, but cuda 11.8 works.

Morningstaripfy commented 10 months ago

same issue in latest version (master) ,but latest version (1.x) works

None5411 commented 8 months ago

same issue,have you solved this problem?or just the problem about version?

Morningstaripfy commented 8 months ago

same issue,have you solved this problem?or just the problem about version?

cuda111/116: mmcv-1.6.1 mmdet-2.x mmrotate 0.x cuda118/120:mmcv-2 mmdet-3 mmrotate-1

None5411 commented 8 months ago

same issue,have you solved this problem?or just the problem about version?

cuda111/116: mmcv-1.6.1 mmdet-2.x mmrotate 0.x cuda118/120:mmcv-2 mmdet-3 mmrotate-1

i did't solve the issue in the version you gived,but i finally solve this in https://zhuanlan.zhihu.com/p/674887894 Thanks for your help

zibiyi commented 8 months ago

same issue,have you solved this problem?or just the problem about version?同样的问题,你解决这个问题了吗?或者只是版本的问题?

cuda111/116: mmcv-1.6.1 mmdet-2.x mmrotate 0.x cuda118/120:mmcv-2 mmdet-3 mmrotate-1Cuda111/116: mmcv-1.6.1 mmdet-2X毫米旋转0。X cuda118/120:mmcv-2 mmdet-3 mmrotate-1

i did't solve the issue in the version you gived,but i finally solve this in https://zhuanlan.zhihu.com/p/674887894我没有在你给的版本中解决问题,但我终于在https://zhuanlan.zhihu.com/p/674887894中解决了这个问题 Thanks for your help 谢谢你的帮助

I have encountered the same problem as you,May I ask if you can provide me with a contact information so that I can communicate with you,我的邮箱是2390417448@qq.com

231055558 commented 5 months ago

same issue,have you solved this problem?or just the problem about version?

cuda111/116: mmcv-1.6.1 mmdet-2.x mmrotate 0.x cuda118/120:mmcv-2 mmdet-3 mmrotate-1

i did't solve the issue in the version you gived,but i finally solve this in https://zhuanlan.zhihu.com/p/674887894 Thanks for your help

Thank you for your sharing. I successfully completed the environment configuration according to the post you shared. My system environment is windows11+cuda11.8/12.2, and the configuration can be successfully completed by following the post operation

amrzv commented 2 months ago

This error still occurs in MMRotate_Tutorial.ipynb.