mikael-alafriz-deel / lucid-sonic-dreams

MIT License
771 stars 157 forks source link

No module named 'dnnlib' #3

Open Readerlution opened 3 years ago

Readerlution commented 3 years ago

I kept running into the error below using the basic example script.

Traceback (most recent call last):
  File "d:\Python\LSD\first.py", line 1, in <module>
    from lucidsonicdreams import LucidSonicDream
  File "D:\python\LSD\lsd\lib\site-packages\lucidsonicdreams\__init__.py", line 1, in <module>
    from .main import *
  File "D:\python\LSD\lsd\lib\site-packages\lucidsonicdreams\main.py", line 32, in <module>
    import dnnlib
ModuleNotFoundError: No module named 'dnnlib'

changed the main.py line 32-33 from

import dnnlib
from dnnlib.tflib.tfutil import * 

to

from stylegan2 import dnnlib
from stylegan2.dnnlib.tflib.tfutil import * 

on my computer and it seems to have fixed that issue

89Q12 commented 3 years ago

For everybody that didnt get it to work with the above mentioned fix try this(should work on windows and linux): Use python 3.7, clone the stylegan2 repo and copy dnnlib in the /lib/site-packages/ folder of your env. Last but not least pip install ffmpeg.

This is not my fix I found it in an comment on reddit form /u/RedditWithBoners

uhapppy commented 3 years ago

take a look a this , the pip install work for me and the bug was fix https://github.com/podgorskiy/dnnlib

fusiformfacearea commented 3 years ago

I worked around this by just putting my script in the stylegan folder

helenawsu commented 3 years ago

No code editing needed: just copy the dnnlib folder and drag it outside of stylegan2 folder

tnkrtst commented 2 years ago

ModuleNotFoundError: No module named 'torch_utils.persistence' is the next issue i had. any thoughts?

mineblamejs commented 6 months ago

ModuleNotFoundError: No module named 'torch_utils.persistence'

Hey there! It seems like you're encountering a ModuleNotFoundError related to torch_utils.persistence. This error typically occurs when the required module is missing from your environment.

Resolution Steps:

  1. Check Dependencies: Ensure that you have all the necessary dependencies installed in your environment. In this case, it seems like you might be missing the torch_utils module.

  2. Installation: If torch_utils is a separate package, you might need to install it using a package manager like pip:

    
    pip install torch-utils