DragGAN
DragGAN copied to clipboard
RuntimeError: Tried to instantiate dummy base class Event
实在不太清楚是那有问题了,大会帮忙吧,困死了
(base) E:\DragGAN>pip list
Package Version
----------------------- ------------
boltons 23.0.0
brotlipy 0.7.0
certifi 2023.5.7
cffi 1.15.1
charset-normalizer 2.0.4
colorama 0.4.6
conda 23.5.0
conda-content-trust 0.1.3
conda-package-handling 2.1.0
conda_package_streaming 0.8.0
cryptography 39.0.1
filelock 3.12.2
idna 3.4
Jinja2 3.1.2
jsonpatch 1.32
jsonpointer 2.1
MarkupSafe 2.1.3
menuinst 1.4.19
mpmath 1.3.0
networkx 3.1
numpy 1.25.0
packaging 23.0
Pillow 9.5.0
pip 23.1.2
pluggy 1.0.0
pycosat 0.6.4
pycparser 2.21
pyOpenSSL 23.0.0
PySocks 1.7.1
requests 2.29.0
ruamel.yaml 0.17.21
ruamel.yaml.clib 0.2.6
setuptools 65.6.3
six 1.16.0
sympy 1.12
toolz 0.12.0
torch 2.0.1+cu118
torchaudio 2.0.2+cu118
torchvision 0.15.2+cu118
tqdm 4.65.0
typing_extensions 4.6.3
urllib3 1.26.16
wheel 0.37.1
win-inet-pton 1.1.0
wincertstore 0.2
zstandard 0.19.0
$ sh scripts/gui.sh
No CUDA runtime is found, using CUDA_HOME='C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1'
Traceback (most recent call last):
File "E:\DragGAN\visualizer_drag.py", line 402, in <module>
main()
File "C:\Users\***\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1130, in __call__
return self.main(*args, **kwargs)
File "C:\Users\***\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1055, in main
rv = self.invoke(ctx)
File "C:\Users\***\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "C:\Users\***\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "E:\DragGAN\visualizer_drag.py", line 396, in main
viz.draw_frame()
File "E:\DragGAN\visualizer_drag.py", line 168, in draw_frame
self._async_renderer.set_args(**self.args)
File "E:\DragGAN\visualizer_drag.py", line 294, in set_args
self._set_args_sync(**args)
File "E:\DragGAN\visualizer_drag.py", line 311, in _set_args_sync
self._renderer_obj = renderer.Renderer()
File "E:\DragGAN\viz\renderer.py", line 78, in __init__
self._start_event = torch.cuda.Event(enable_timing=True)
File "C:\Users\***\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\cuda\streams.py", line 164, in __new__
return super(Event, cls).__new__(
File "C:\Users\***\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\cuda\_utils.py", line 46, in err_fn
raise RuntimeError(
RuntimeError: Tried to instantiate dummy base class Event
Have same issue on anaconda of windows and failed to find way to solve it. The Event classes are only used to record elapsing time.
Quick fix: try to bypass the errors by commenting out self._start_event
and self._end_event
related code in viz.renderer
.
Have same issue on anaconda of windows and failed to find way to solve it. The Event classes are only used to record elapsing time. Quick fix: try to bypass the errors by commenting out
self._start_event
andself._end_event
related code inviz.renderer
.
it worked , thx bro. I follow you advise, success by pass the errors. but i have another errors like torch and cuda things , work on it , thank alot
Yes, after commenting, this error:
\Python310\lib\site-packages\torch\cuda_init_.py", line 239, in _lazy_init
raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled
Yes, after commenting, this error: \Python310\lib\site-packages\torch\cuda__init__.py", line 239, in _lazy_init raise AssertionError("Torch not compiled with CUDA enabled") AssertionError: Torch not compiled with CUDA enabled
Try install torch with cuda support if it doesn't. My cmd is pip install torch==2.0.1+cu118 --extra-index-url https://download.pytorch.org/whl/cu118
Hello, same error here. Could you please let me know how to comment out "self._start_event" and "self._end_event" in "renderer.py" and why they are related to "\anaconda3\lib\site-packages\torch\cuda_utils.py"? Thank you for your support.
Hi all, I am getting this error:
No CUDA runtime is found, using CUDA_HOME='C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8'
Traceback (most recent call last):
File "C:\Users\apext\Downloads\DragGan\DragGAN\visualizer_drag.py", line 403, in
How can I solve this problem? If you can show me pictures where you show me how it is, it would be better because I'm not very familiar with these things XD
Try python -c "import torch; print(torch.version)" for torch version. The "event error" is not actual error. For my case there was torch+CPU installation instead torch+CUDA.
P.S. There error in requirement.txt Line like "torch>=2.0.0" install cpu vesrion. Change it to something like "torch>=2.0.0+cu111" for gpu version installation.
How can I solve this problem? If you can show me pictures where you show me how it is, it would be better because I'm not very familiar with these things XD
For example, in viz/renderer.py, let "disable_timing = True", which could comment out both of them. It works, but I still don't know other more useful functions.
hello, unfortunately I was not able to understand what you told me. I asked if you could kindly take pictures of the various procedures, since I'm not really familiar with these things. BUT nothing done. Oh well, thanks anyway
Sorry for delay. I am on vacation now.
Answer:
- This is not project error
- This may be invalid environment error
- CUDA version of PyTorch required
- Check you PyTorch version
- Install right PyTorch+CUDA version
P.S. If you use this project requirements.txt file - you get wrong pytorch version installed (CPU)
This worked for me pip install torch==2.1.1+cu118 --extra-index-url https://download.pytorch.org/whl/cu118
( Anaconda / Windows )
Have same issue on anaconda of windows and failed to find way to solve it. The Event classes are only used to record elapsing time. Quick fix: try to bypass the errors by commenting out
self._start_event
andself._end_event
related code inviz.renderer
.it worked , thx bro. I follow you advise, success by pass the errors. but i have another errors like torch and cuda things , work on it , thank alot
hi,bro,I'm facing the same problem. Did you solve it?