mindspore-lab / mindone

one for all, Optimal generator with No Exception
https://mindspore-lab.github.io/mindone/
Apache License 2.0
354 stars 68 forks source link

fixed test bug for import path #329

Closed Songyuanwei closed 8 months ago

zhtmike commented 8 months ago

what bug it has originally?

Songyuanwei commented 8 months ago

what bug it has originally?

https://e.gitee.com/mind_spore/issues/list?issue_type_category=bug&issue=I9034O Traceback (most recent call last): File "tests/st/test_overfit.py", line 17, in from _common import down_checkpoint File "/data/TDT_deployment/solution_test/cases/02network/11one/sd15/train/test_ms_sd15_dreambooth_overfit_train_ascend_1p_0002/examples/stable_diffusion_v2/tests/st/_common.py", line 8, in from tools.eval.fid.utils import Download ModuleNotFoundError: No module named 'tools.eval'

zhtmike commented 8 months ago

why this fix can resolve the bug? don't understand..

Songyuanwei commented 8 months ago

what bug it has originally?

https://e.gitee.com/mind_spore/issues/list?issue_type_category=bug&issue=I9034O Traceback (most recent call last): File "tests/st/test_overfit.py", line 17, in from _common import down_checkpoint File "/data/TDT_deployment/solution_test/cases/02network/11one/sd15/train/test_ms_sd15_dreambooth_overfit_train_ascend_1p_0002/examples/stable_diffusion_v2/tests/st/_common.py", line 8, in from tools.eval.fid.utils import Download ModuleNotFoundError: No module named 'tools.eval'

it is need add init.py to tools and use sys.path.insert(0, ".") instead of sys.path.append(".") for _common.py

Songyuanwei commented 8 months ago

why this fix can resolve the bug? don't understand..

Running locally does not require modification, but the test team will automatically set export PYTHONPATH=solution_test_path:$PYTHONPATH the monitoring case to run on their own CI, and this modification is necessary. This modification will not affect local Run