@@ -60,6 +60,29 @@ def main():
60
60
if args .bg_upsampler == 'realesrgan' :
61
61
if not torch .cuda .is_available (): # CPU
62
62
import warnings
63
+
64
+ warnings .warn ('Here is going to run `--bg_upsampler=realesrgan` in CPU (not CUDA) power.' )
65
+
66
+ if torch .__version__ .endswith ('+cpu' ):
67
+ warnings .warn ('This is because installed version of '
68
+ 'PyTorch is `%s`.' % (torch .__version__ , ))
69
+ warnings .warn ('If you are sure to have CUDA enabled device, '
70
+ 'you can try to install CUDA capable PyTorch. '
71
+ 'Visit https://pytorch.org/get-started/locally/ '
72
+ 'and check START LOCALLY section.' )
73
+ warnings .warn ('In 12 Nov 2022, this is useful to install CUDA powered PyTorch: '
74
+ 'pip3 install torch==1.12.1+cu116 --index-url https://download.pytorch.org/whl/cu116' )
75
+ warnings .warn ('If you already have PyTorch installed, it needs to be uninstalled. try: '
76
+ 'pip3 uninstall torch' )
77
+ else :
78
+ warnings .warn ('This is because no CUDA capable device is detected.' )
79
+
80
+ warnings .warn ('To print PyTorch version by yourself, try: '
81
+ 'python -c "import torch; print(torch.__version__)"' )
82
+
83
+ warnings .warn ('To verify if PyTorch can detect CUDA, try: '
84
+ 'python -c "import torch; print(torch.cuda.is_available())"' )
85
+
63
86
warnings .warn ('The unoptimized RealESRGAN is slow on CPU. We do not use it. '
64
87
'If you really want to use it, please modify the corresponding codes.' )
65
88
bg_upsampler = None
0 commit comments