mmrotate icon indicating copy to clipboard operation
mmrotate copied to clipboard

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

Open ning-feng opened this issue 1 year ago • 8 comments

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.

ning-feng avatar Dec 27 '23 09:12 ning-feng

same issue, but cuda 11.8 works.

Jimmy1456 avatar Dec 29 '23 09:12 Jimmy1456

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

Morningstaripfy avatar Jan 04 '24 03:01 Morningstaripfy

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

None5411 avatar Mar 05 '24 14:03 None5411

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

Morningstaripfy avatar Mar 06 '24 06:03 Morningstaripfy

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

None5411 avatar Mar 08 '24 03:03 None5411

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,我的邮箱是[email protected]

zibiyi avatar Mar 17 '24 13:03 zibiyi

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

231055558 avatar Jun 01 '24 11:06 231055558