pesser / stable-diffusion

MIT License
1.03k stars 395 forks source link

AttributeError: partially initialized module 'torch' has no attribute 'Tensor' (most likely due to a circular import) #9

Closed num421337 closed 1 year ago

num421337 commented 1 year ago

I tried running the test command and got this error. I wouldn't be surprised if I screwed something up. I uninstalled and reinstalled torch and tensor to no avail.

H:\stable>python scripts/txt2img.py --prompt "a virus monster is playing guitar, oil on canvas" --ddim_eta 0.0 --n_samples 4 --n_iter 4 --scale 5.0  --ddim_steps 50
Traceback (most recent call last):
  File "H:\stable\scripts\txt2img.py", line 2, in <module>
    import torch
  File "E:\anaconda3\lib\site-packages\torch\__init__.py", line 255, in <module>
    from .random import set_rng_state, get_rng_state, manual_seed, initial_seed, seed
  File "E:\anaconda3\lib\site-packages\torch\random.py", line 9, in <module>
    def set_rng_state(new_state: torch.Tensor) -> None:
AttributeError: partially initialized module 'torch' has no attribute 'Tensor' (most likely due to a circular import)
num421337 commented 1 year ago

figured it out

somecoulombs commented 1 year ago

figured it out

I'm going to lose my absolute fucking mind, I finally come across someone with the same issue and they close it with 'figured it out'. Jesus Christ dude, what fixed it

num421337 commented 1 year ago

Ill have to double check. Part of my problem was having conda and python installed and my prompt was confused which was which. I then made sure the installs for tensor and torch were complete

num421337 commented 1 year ago

And to be fair i never got it to fully work. I dont have enough vram to run this apparently