consistency_models icon indicating copy to clipboard operation
consistency_models copied to clipboard

ModuleNotFoundError: No module named 'cm'

Open michaeltan53 opened this issue 2 years ago • 3 comments

ModuleNotFoundError: No module named 'cm'

How to solve this problem when importing classes from cm package? Does it mean that the project have to be built first?

michaeltan53 avatar Nov 16 '23 07:11 michaeltan53

The 'cm' module is already in the directory of 'consistency_models-main'. If your current directory where you run *.py (or other program) is not the same path as ‘cm’, then your "ModuleNotFoundError: No module named 'cm'" will occour.

levisocool avatar Nov 17 '23 02:11 levisocool

The 'cm' module is already in the directory of 'consistency_models-main'. If your current directory where you run *.py (or other program) is not the same path as ‘cm’, then your "ModuleNotFoundError: No module named 'cm'" will occour. 图片 i run ./scripts/cm_train.py,but still meet same error.

Ontheroad123 avatar Jan 12 '24 01:01 Ontheroad123

The 'cm' module is already in the directory of 'consistency_models-main'. If your current directory where you run *.py (or other program) is not the same path as ‘cm’, then your "ModuleNotFoundError: No module named 'cm'" will occour. 图片 i run ./scripts/cm_train.py,but still meet same error.

I haver solve this problem, run 'python cm_train.py' and add 'sys.path.append('../')' in cm_train.py

Ontheroad123 avatar Jan 12 '24 01:01 Ontheroad123