module 'torch._C' has no attribute '_cuda_setDevice'

543 views
Skip to first unread message

idtrackerai

unread,
Feb 10, 2023, 6:39:54 AM2/10/23
to idtracker.ai users group
Many of you are having errors when running idtracker in fresh installations. The error appears as module 'torch._C' has no attribute '_cuda_setDevice'

The issue is about the installation of Pytorch, it no longer installs properly following the steps from our website. Pyroch has to be installed following their instructions here.

If you encounter this error, the way for you to proceed is to create a new Conda environment, activate it, install idtrackerai (pip install ...) and then install pytorch with the command you get from their website (it depends on your OS, and CUDA version...).

Sorry for the inconvenience, we will update these step in our website soon.

Jordi

idtrackerai

unread,
Feb 21, 2023, 3:41:22 AM2/21/23
to idtracker.ai users group
If Pytorch installation with "conda install ..." gets stucked in "Solving environment:" for more than 10 minutes (specially on Windows), try to install it again using "pip". Go to Pytorch website and set "Package"  to "Pip".

Humaira Rana

unread,
May 4, 2023, 2:49:50 AM5/4/23
to idtracker.ai users group
Hi,

I selected CPU option with this command: 
pip3 install torch torchvision torchaudio

and opted for track w/o identities. still, it generates this error: 

       ERROR    An error occurred, saving data before printing traceback and exiting the       run_idtrackerai.py:139
                  program
         INFO     Saving video object in                                                                   video.py:504
                  C:\Users\Crop2x\Desktop\IDTRacker.ai\session_no_name\video_object.json
11:49:26 INFO     Saving ListOfBlobs at                                                            list_of_blobs.py:133
                  C:\Users\Crop2x\Desktop\IDTRacker.ai\session_no_name\preprocessing\list_of_blobs
                  .pickle
         CRITICAL module 'torch._C' has no attribute '_cuda_setDevice'                                init_logger.py:73
                  Traceback (most recent call last):
                    File
                  "C:\Users\Crop2x\Desktop\IDTRacker.ai\myenv\Lib\site-packages\idtrackerai\utils\ini
                  t_logger.py", line 68, in applicator
                      return main_function(*args, **kwargs)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                    File
                  "C:\Users\Crop2x\Desktop\IDTRacker.ai\myenv\Lib\site-packages\idtrackerai_start_app
                  \__main__.py", line 112, in main
                      return RunIdTrackerAi(parameters).track_video()
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                    File
                  "C:\Users\Crop2x\Desktop\IDTRacker.ai\myenv\Lib\site-packages\idtrackerai_start_app
                  \run_idtrackerai.py", line 144, in track_video
                      raise error
                    File
                  "C:\Users\Crop2x\Desktop\IDTRacker.ai\myenv\Lib\site-packages\idtrackerai_start_app
                  \run_idtrackerai.py", line 90, in track_video
                      crossings_detection_API(self.video, self.list_of_blobs)
                    File
                  "C:\Users\Crop2x\Desktop\IDTRacker.ai\myenv\Lib\site-packages\idtrackerai\crossings
                  _detection\crossings_detection.py", line 74, in crossings_detection_API
                      detect_crossings(list_of_blobs, video)
                    File
                  "C:\Users\Crop2x\Desktop\IDTRacker.ai\myenv\Lib\site-packages\idtrackerai\crossings
                  _detection\crossing_detector.py", line 141, in detect_crossings
                      torch.cuda.set_device(0)
                    File
                  "C:\Users\Crop2x\Desktop\IDTRacker.ai\myenv\Lib\site-packages\torch\cuda\__init__.p
                  y", line 350, in set_device
                      torch._C._cuda_setDevice(device)
                      ^^^^^^^^^^^^^^^^^^^^^^^^
                  AttributeError: module 'torch._C' has no attribute '_cuda_setDevice'

idtrackerai

unread,
May 4, 2023, 6:03:59 AM5/4/23
to idtracker.ai users group
This is a Pytorch error. It tells you that it cannot use CUDA capabilities and it is a bit tricky to solve. So:
  • Does idtrackerai_test work? (I guess not)
  • Does you computer have a dedicated Nvidia GPU? If it does, does the command nvidia-smi output something like this?
  • Have you installed Pytorch with Pip because it was Solving environment: eternally?
  • Does the Conda environment where idtrackerai is have Python 3.10 (not 3.9, 3.11, ...)? (run python --version to get the current version)
My experience with this specific error is that it cannot be fixed without previously removing the enviroment and creating it again. Try to reinstall everything following the website instructions and tell me how it's doing.

Jordi

Engr. Humaira Rana

unread,
May 5, 2023, 1:39:32 AM5/5/23
to idtra...@gmail.com, idtracker.ai users group
Hi,

Thank you for prompt reply.
To answer your questions:
- No
- I don't have GPU
- Yes
- python 3.11.3 is installed

Can I run it without GPU in my PC?

One more thing, can you share what deep learning algorithms are used in the tracker? Are they supervised or unsupervised?

--
You received this message because you are subscribed to a topic in the Google Groups "idtracker.ai users group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/idtrackerai_users/RJo1R8vsIlQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to idtrackerai_us...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/idtrackerai_users/73849f97-0ac7-4409-b9cd-82728db5870an%40googlegroups.com.


--
Best Regards,
Engr. Humaira Rana

idtrackerai

unread,
May 5, 2023, 6:21:00 AM5/5/23
to idtracker.ai users group
While our website states the other way, idtrackerai can't currently track videos without a Nvidia GPU, even without identities. I'm gonna correct the website now.

Without a Nvidia GPU, you can only work with the additional tools (segmentation app, validator, video generator...). In the future we will provide proper support for computers without Nvidia GPU. Sorry for the inconvenience.

Regarding the learning algorithms of idtrackerai, the tracking process doesn't need any human supervision. You can find all the details in the article.

Jordi
Reply all
Reply to author
Forward
0 new messages