Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [26 lines of output]
Traceback (most recent call last):
File "/tmp/pip-install-_h0cg0e2/basicsr_f6e24d42eda94c67800f8a48e46b0e6a/setup.py", line 50, in get_hash
from basicsr.version import __version__
File "/tmp/pip-install-_h0cg0e2/basicsr_f6e24d42eda94c67800f8a48e46b0e6a/basicsr/__init__.py", line 3, in
from .archs import *
File "/tmp/pip-install-_h0cg0e2/basicsr_f6e24d42eda94c67800f8a48e46b0e6a/basicsr/archs/__init__.py", line 5, in
from basicsr.utils import get_root_logger, scandir
File "/tmp/pip-install-_h0cg0e2/basicsr_f6e24d42eda94c67800f8a48e46b0e6a/basicsr/utils/__init__.py", line 3, in
from .img_process_util import USMSharp, usm_sharp
File "/tmp/pip-install-_h0cg0e2/basicsr_f6e24d42eda94c67800f8a48e46b0e6a/basicsr/utils/img_process_util.py", line 1, in
import cv2
ModuleNotFoundError: No module named 'cv2'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "", line 2, in
File "", line 34, in
File "/tmp/pip-install-_h0cg0e2/basicsr_f6e24d42eda94c67800f8a48e46b0e6a/setup.py", line 139, in
write_version_py()
File "/tmp/pip-install-_h0cg0e2/basicsr_f6e24d42eda94c67800f8a48e46b0e6a/setup.py", line 67, in write_version_py
sha = get_hash()
^^^^^^^^^^
File "/tmp/pip-install-_h0cg0e2/basicsr_f6e24d42eda94c67800f8a48e46b0e6a/setup.py", line 53, in get_hash
raise ImportError('Unable to get git version')
ImportError: Unable to get git version
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
parser.add_argument("--listen", action="store_true", help="launch gradio with 0.0.0.0 as server name, allowing to respond to network requests")
webui.py里:
api.launch(
server_name="0.0.0.0" if cmd_opts.listen else "127.0.0.1",
...
)
注1: 对于同一个局域网下,不在宿主机上直接打开网页的同学,可以在你的主机浏览器里输入:
宿主机ip:7860
注2:如果要用CPU推理( 😀 ) ,可能出现报错:
RuntimeError: "xxx" not implemented for 'Half'
解决:启动 webui.py 的时候,再加上参数 --no-half
注3:如果报错 CUDA out of memory:
torch.cuda.OutOfMemoryError: CUDA out of memory. {省略一长串}. If reserved but unallocated memory is large try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF