mykcs / DoesFS-0430-delay

2024 0430 issue 1 因为macos,暂时搁置
0 stars 0 forks source link

ImportError: Bindings generation error. Submodule name should always start with a parent module name. Parent name: cv2.cv2. Submodule name: cv2 #1

Open mykcs opened 7 months ago

mykcs commented 7 months ago
❯ python inference.py --style=style3 --input_image=./data/test_inputs/002.png --alpha=0.8
Traceback (most recent call last):* 1m 36s ❯ python inference.py --style=style3 --input_image=./data/test_inputs/002.png --alpha=0.8                                                                                      19:46:12
  File "/Users/myk/Repo/DoesFS-0430/inference.py", line 8, in <module>
    from face_align import align_face
  File "/Users/myk/Repo/DoesFS-0430/face_align.py", line 9, in <module>
    import cv2.cv2 as cv
ImportError: Bindings generation error. Submodule name should always start with a parent module name. Parent name: cv2.cv2. Submodule name: cv2
mykcs commented 7 months ago
import cv2.cv2 as cv

评价:没见过这种写法,感觉好怪 改为

import cv2 as cv
mykcs commented 7 months ago
❯ python inference.py --style=style3 --input_image=./data/test_inputs/002.png --alpha=0.8
Traceback (most recent call last):
  File "/Users/myk/Repo/DoesFS-0430/inference.py", line 38, in <module>
    generator = DeformAwareGenerator(1024, 512, 8, 2, resolutions=tps_swap_resolutions,
  File "/Users/myk/anaconda3/envs/env-DoesFS/lib/python3.9/site-packages/torch/nn/modules/module.py", line 989, in to
    return self._apply(convert)
  File "/Users/myk/anaconda3/envs/env-DoesFS/lib/python3.9/site-packages/torch/nn/modules/module.py", line 641, in _apply
    module._apply(fn)
  File "/Users/myk/anaconda3/envs/env-DoesFS/lib/python3.9/site-packages/torch/nn/modules/module.py", line 641, in _apply
    module._apply(fn)
  File "/Users/myk/anaconda3/envs/env-DoesFS/lib/python3.9/site-packages/torch/nn/modules/module.py", line 664, in _apply
    param_applied = fn(param)
  File "/Users/myk/anaconda3/envs/env-DoesFS/lib/python3.9/site-packages/torch/nn/modules/module.py", line 987, in convert
    return t.to(device, dtype if t.is_floating_point() or t.is_complex() else None, non_blocking)
  File "/Users/myk/anaconda3/envs/env-DoesFS/lib/python3.9/site-packages/torch/cuda/__init__.py", line 221, in _lazy_init
    raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled
mykcs commented 7 months ago

好吧,我是macbook,也没有cuda 学一学怎么用google colab,再回来吧