StableCascade icon indicating copy to clipboard operation
StableCascade copied to clipboard

ModuleNotFoundError: No module named 'inference.utils'

Open vishwas-agrawal01 opened this issue 1 year ago • 2 comments

Try to run the notebook for Image to Image, but can't able to locate from inference.utils import * from core.utils import load_or_fail from train import WurstCoreC, WurstCoreB

can't able to locate any of these module inference.utils, core, train

ModuleNotFoundError: No module named 'inference.utils' ModuleNotFoundError: No module named 'core' ModuleNotFoundError: No module named 'train'

vishwas-agrawal01 avatar Feb 13 '24 20:02 vishwas-agrawal01

Add the root of the project to your path.

import sys

sys.path.append('./)

And where it says os.chdir('..'), change that to the root of the project too. For instance, if you have the repo for the project in a folder called Projects on your home drive:

os.chdir('~/Projects/StableCascade')

You won't be at risk of changing your current working directory further up the tree each time you run the script if you make that change.

mcawte avatar Feb 14 '24 09:02 mcawte

Also getting this error when try to load code from notebook for super resolution: ModuleNotFoundError Traceback (most recent call last) Cell In[1], line 8 5 from tqdm import tqdm 7 os.chdir('..') ----> 8 from inference.utils import * 9 from core.utils import load_or_fail 10 from train import ControlNetCore, WurstCoreB

ModuleNotFoundError: No module named 'inference.utils' please advice! I am using Windows.

zelenooki87 avatar Feb 18 '24 11:02 zelenooki87