MooreThreads / Moore-AnimateAnyone

Character Animation (AnimateAnyone, Face Reenactment)
Apache License 2.0
2.98k stars 231 forks source link

ModuleNotFoundError: No module named 'tracker' #131

Closed A-2-H closed 2 months ago

A-2-H commented 2 months ago

I used anaconda virtual environment and also .venv python 3.10 - tested on both. I also tested it in python 3.11. When installed dependencies i tried to make inference for Face Reenactment and got this error:

python -m scripts.lmks2vid --config ./configs/prompts/inference_reenact.yaml --driving_video_path "S:\AIprograms\AnimateAnyone\configs\inference\video\test4.mp4" --source_image_path "S:\AIprograms\AnimateAnyone\configs\inference\ref_images\test4.png"
WARNING[XFORMERS]: xFormers can't load C++/CUDA extensions. xFormers was built for:
    PyTorch 2.0.1+cu118 with CUDA 1108 (you have 2.0.1+cpu)
    Python  3.10.11 (you have 3.10.0)
  Please reinstall xformers (see https://github.com/facebookresearch/xformers#installing-xformers)
  Memory-efficient attention, SwiGLU, sparse and more won't be available.
  Set XFORMERS_MORE_DETAILS=1 for more details
Traceback (most recent call last):
  File "C:\Users\benia\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\benia\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "S:\AIprograms\AnimateAnyone\scripts\lmks2vid.py", line 34, in <module>
    from tools.facetracker_api import face_image
  File "S:\AIprograms\AnimateAnyone\tools\facetracker_api.py", line 7, in <module>
    from tracker import Tracker, get_model_base_path
ModuleNotFoundError: No module named 'tracker'

and after pip install tracker i get this error:

python -m scripts.lmks2vid --config ./configs/prompts/inference_reenact.yaml --driving_video_path "S:\AIprograms\AnimateAnyone\configs\inference\video\test4.mp4" --source_image_path "S:\AIprograms\AnimateAnyoneAlibaba\configs\inference\ref_images\test4.png"
WARNING[XFORMERS]: xFormers can't load C++/CUDA extensions. xFormers was built for:
    PyTorch 2.0.1+cu118 with CUDA 1108 (you have 2.0.1+cpu)
    Python  3.10.11 (you have 3.10.0)
  Please reinstall xformers (see https://github.com/facebookresearch/xformers#installing-xformers)
  Memory-efficient attention, SwiGLU, sparse and more won't be available.
  Set XFORMERS_MORE_DETAILS=1 for more details
Traceback (most recent call last):
  File "C:\Users\benia\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\benia\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "S:\AIprograms\AnimateAnyone\scripts\lmks2vid.py", line 34, in <module>
    from tools.facetracker_api import face_image
  File "S:\AIprograms\AnimateAnyone\tools\facetracker_api.py", line 7, in <module>
    from tracker import Tracker, get_model_base_path
  File "S:\AIprograms\AnimateAnyone\.venv\lib\site-packages\tracker\__init__.py", line 1, in <module>
    from .tracker import tracked
  File "S:\AIprograms\AnimateAnyone\.venv\lib\site-packages\tracker\tracker.py", line 4, in <module>
    from .snapshot import Snapshot
  File "S:\AIprograms\AnimateAnyone\.venv\lib\site-packages\tracker\snapshot.py", line 2, in <module>
    from itertools import izip_longest
ImportError: cannot import name 'izip_longest' from 'itertools' (unknown location)

I tried to change "izip" to "zip" in "snapshot.py" but error still persists.

(AniANY311) S:\AIprograms\AnimateAnyone>python -m scripts.lmks2vid --config ./configs/prompts/inference_reenact.yaml --driving_video_path "S:\AIprograms\AnimateAnyone\configs\inference\video\test4.mp4" --source_image_path "S:\AIprograms\AnimateAnyone\configs\inference\ref_images\test4.png"
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "S:\AIprograms\AnimateAnyone\scripts\lmks2vid.py", line 34, in <module>
    from tools.facetracker_api import face_image
  File "S:\AIprograms\AnimateAnyone\tools\facetracker_api.py", line 7, in <module>
    from tracker import Tracker, get_model_base_path
ImportError: cannot import name 'Tracker' from 'tracker'

Any ideas? My conclusion is that there is some lack of dependencies in requirements.txt or repo is missing some necessary libraries - "tracker" because "facetracker_api.py" can't import "Tracker" from "tracker" (?)

liangyang-mt commented 2 months ago

Thank you for following our work. Before face reenactment inference, did you execute this command: git clone https://github.com/emilianavt/OpenSeeFace.git or download OpenSeeFace.zip and unzip it in the current directory? The "tracker" module is from OpenSeeFace.

A-2-H commented 2 months ago

Thank you for following our work. Before face reenactment inference, did you execute this command: git clone https://github.com/emilianavt/OpenSeeFace.git or download OpenSeeFace.zip and unzip it in the current directory? The "tracker" module is from OpenSeeFace.

I was sure I did this step, but I couldn't find OpenSeeFace in my directory. I did it once again now and I was able to pass this error. Thank you.