Open TanvirHafiz opened 1 year ago
reinstalled torch frest now digging this issue
C:\Users\Tanvir\AppData\Local\Programs\Python\Python310\lib\site-packages\mmcv__init.py:20: UserWarning: On January 1, 2023, MMCV will release v2.0.0, in which 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(
download checkpoints ......
download successfully!
Initializing BaseSegmenter to cuda:3
Traceback (most recent call last):
File "G:\Track-Anything\app.py", line 385, in TORCH_USE_CUDA_DSA
to enable device-side assertions.
Same issue here.
same here any chance this was resolved?
The error message is misleading, I think the issue is that app.py
hardcodes args.device = "cuda:3"
which will fail if you have only one card. Try removing that line, in this case the --device
command line parameter will actually work again and will also use cuda:0
as default, which should be fine for most users.
Same issue, even when commenting out the cuda:3 line
Torch not compiled with CUDA enabled
File "C:\Track-Anything\tools\base_segmenter.py", line 26, in __init__
self.model.to(device=self.device)
File "C:\Track-Anything\tools\interact_tools.py", line 37, in __init__
self.sam_controler = BaseSegmenter(SAM_checkpoint, model_type, device)
File "C:\Track-Anything\track_anything.py", line 18, in __init__
self.samcontroler = SamControler(self.sam_checkpoint, args.sam_model_type, args.device)
File "C:\Track-Anything\app.py", line 385, in <module>
model = TrackingAnything(SAM_checkpoint, xmem_checkpoint, e2fgvi_checkpoint,args)
AssertionError: Torch not compiled with CUDA enabled
it’s not the same actually you have to install torch that matches your cuda version.
I was looking at other posts about this problem, and after putting
import torch
print("Torch version:",torch.__version__)
print("Is CUDA enabled?",torch.cuda.is_available())
I find
Torch version: 2.0.1+cpu
Is CUDA enabled? False
I use a 3080, so not sure why the CPU version is being used. I was under the impression the pip requirements would install CUDA but now I'm getting the package straight from Nvidia via .exe
you have to conda install torch with the cuda version that it is compatible. you got torch 2.0.1 installed i think that requires cuda 12 at least
Seems like I still have the same problem. Even deleted the env and clean installed
I'll have to dig into why CUDA may not be turning on despite the env seemingly 'seeing' it.
Update: I got it working by following the procedure on this page: https://www.educative.io/answers/how-to-resolve-torch-not-compiled-with-cuda-enabled. Had to uninstall Torch and reinstall using instructions here: https://pytorch.org/get-started/locally/
Please change "cuda:3"
to "cuda:0"
in app.py
file (line 380) then install gradio pip install gradio==3.39.0
.
(venv) F:\Track-Anything>python app.py --device cuda:0
F:\Track-Anything\venv\lib\site-packages\gradio_client\documentation.py:103: UserWarning: Could not get documentation group for <class 'gradio.mix.Parallel'>: No known documentation group for module 'gradio.mix'
warnings.warn(f"Could not get documentation group for {cls}: {exc}")
F:\Track-Anything\venv\lib\site-packages\gradio_client\documentation.py:103: UserWarning: Could not get documentation group for <class 'gradio.mix.Series'>: No known documentation group for module 'gradio.mix'
warnings.warn(f"Could not get documentation group for {cls}: {exc}")
Initializing BaseSegmenter to cuda:0
Traceback (most recent call last):
File "F:\Track-Anything\app.py", line 385, in
changed GPU to 3090. all the other programs that uses CUDA works. except this one. removed the line with cuda:3, installed gradio 3.39, sti;; same error
it says "Torch not compiled with CUDA enabled" how do i enable CUDA and compile torch??? or am I doing something wrong!
I get this
C:\Users\Tanvir\AppData\Local\Programs\Python\Python310\lib\site-packages\torchvision\io\image.py:13: UserWarning: Failed to load image Python extension: Could not find module 'C:\Users\Tanvir\AppData\Local\Programs\Python\Python310\Lib\site-packages\torchvision\image.pyd' (or one of its dependencies). Try using the full path with constructor syntax. warn(f"Failed to load image Python extension: {e}") No CUDA runtime is found, using CUDA_HOME='C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1' C:\Users\Tanvir\AppData\Local\Programs\Python\Python310\lib\site-packages\mmcv__init.py:20: UserWarning: On January 1, 2023, MMCV will release v2.0.0, in which 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( Initializing BaseSegmenter to cuda:3 Traceback (most recent call last): File "G:\Track-Anything\app.py", line 385, in
model = TrackingAnything(SAM_checkpoint, xmem_checkpoint, e2fgvi_checkpoint,args)
File "G:\Track-Anything\track_anything.py", line 18, in init
self.samcontroler = SamControler(self.sam_checkpoint, args.sam_model_type, args.device)
File "G:\Track-Anything\tools\interact_tools.py", line 37, in init
self.sam_controler = BaseSegmenter(SAM_checkpoint, model_type, device)
File "G:\Track-Anything\tools\base_segmenter.py", line 26, in init__
self.model.to(device=self.device)
File "C:\Users\Tanvir\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 907, in to
return self._apply(convert)
File "C:\Users\Tanvir\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 578, in _apply
module._apply(fn)
File "C:\Users\Tanvir\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 578, in _apply
module._apply(fn)
File "C:\Users\Tanvir\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 578, in _apply
module._apply(fn)
File "C:\Users\Tanvir\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 601, in _apply
param_applied = fn(param)
File "C:\Users\Tanvir\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 905, in convert
return t.to(device, dtype if t.is_floating_point() or t.is_complex() else None, non_blocking)
File "C:\Users\Tanvir\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\cuda__init__.py", line 210, in _lazy_init
raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled
but I have cuda 12.1 and 11.7 installed