greatlog / DAN

This is an official implementation of Unfolding the Alternating Optimization for Blind Super Resolution
231 stars 41 forks source link

'OrderedYaml' is not defined #26

Closed ontheway16 closed 3 years ago

ontheway16 commented 3 years ago

I am having the following error;

~/DAN/codes/config/DANv1$ python3 test.py -opt=options/setting1/test_setting1_x4.yml
Traceback (most recent call last):
  File "test.py", line 12, in <module>
    import options as option
  File "/home/alper/DAN/codes/config/DANv1/options.py", line 14, in <module>
    Loader, Dumper = OrderedYaml()
NameError: name 'OrderedYaml' is not defined
wileewang commented 3 years ago

You may change options.py file from ' try: sys.path.append("../../") from utils import OrderedYaml except ImportError: pass '

to

' sys.path.append("../../") from utils import OrderedYaml ' You will get more details about error in this way, such as some packages are not installed.

alexgg94 commented 3 years ago

I have the same issue. Im my case, after importing it without try-catch, I'm getting ImportError: cannot import name 'OrderedYaml' from 'utils' (C:\Users\ag\Miniconda3\envs\tf\lib\site-packages\utils__init__.py).

Looks like wrong utils was used.

Changed

sys.path.append("../../")
from utils import OrderedYaml

To

sys.path.append("../../utils")
from file_utils import OrderedYaml