2s-AGCN icon indicating copy to clipboard operation
2s-AGCN copied to clipboard

some kind of device error

Open alirazaee opened this issue 3 years ago • 4 comments

Traceback (most recent call last): File "/media/ali/hdd6/Onedrive data/PycharmProjects/activity_rec1/2s-AGCN-master/main.py", line 577, in processor = Processor(arg) File "/media/ali/hdd6/Onedrive data/PycharmProjects/activity_rec1/2s-AGCN-master/main.py", line 213, in init self.load_model() File "/media/ali/hdd6/Onedrive data/PycharmProjects/activity_rec1/2s-AGCN-master/main.py", line 286, in load_model output_device=output_device) File "/home/ali/anaconda3/envs/activity_rec/lib/python3.7/site-packages/torch/nn/parallel/data_parallel.py", line 136, in init _check_balance(self.device_ids) File "/home/ali/anaconda3/envs/activity_rec/lib/python3.7/site-packages/torch/nn/parallel/data_parallel.py", line 19, in _check_balance dev_props = [torch.cuda.get_device_properties(i) for i in device_ids] File "/home/ali/anaconda3/envs/activity_rec/lib/python3.7/site-packages/torch/nn/parallel/data_parallel.py", line 19, in dev_props = [torch.cuda.get_device_properties(i) for i in device_ids] File "/home/ali/anaconda3/envs/activity_rec/lib/python3.7/site-packages/torch/cuda/init.py", line 317, in get_device_properties raise AssertionError("Invalid device id") AssertionError: Invalid device id

Process finished with exit code 1

alirazaee avatar Oct 15 '20 10:10 alirazaee

In case you couldn't solve it yet: You may need to edit the device property in the config files, so that it matches your used GPU(s).

Ida-Ida avatar Nov 18 '20 13:11 Ida-Ida

How to edit the device?

liqier avatar Nov 18 '20 23:11 liqier

Inside your config/ntu.../..yaml file, you can specify different parameters. Among them, device:. E.g. if you have only one available GPU, set the device parameter to the index 0. Probably you need to reduce the batch size parameter there as well. If it‘s too high, you‘ll get a CUDA out of memory error.

Pls note: you may need to learn more about how pytorch / CUDA and the config works in general, especially if you run in further issues.

Ida-Ida avatar Nov 19 '20 00:11 Ida-Ida

Thank you very much.

liqier avatar Nov 19 '20 00:11 liqier