ckkelvinchan / RealBasicVSR

Official repository of "Investigating Tradeoffs in Real-World Video Super-Resolution"
Apache License 2.0
906 stars 136 forks source link

'ConfigDict' object has no attribute 'model' #31

Closed format37 closed 2 years ago

format37 commented 2 years ago

Hi. I am installed that:

conda create -n vsr3 python=3.7 -y
conda activate vsr3
conda install pytorch==1.7.1 torchvision==0.8.2 torchaudio==0.7.2 cudatoolkit=10.1 -c pytorch -y
conda install -c omnia openmm -y
#conda install -c esri mmcv-full -y
pip install mmcv-full==1.3.17 -f https://download.openmmlab.com/mmcv/dist/11.1/torch1.10.0/index.html
python3 -m pip install mmedit

Then i run:

python inference_realbasicvsr.py configs/realbasicvsr_x4.py checkpoints/RealBasicVSR_x4.pth data/demo_001.mp4 results/demo_001.mp4 --fps=12.5

Then get an error:

Traceback (most recent call last):
  File "inference_realbasicvsr.py", line 148, in <module>
    main()
  File "inference_realbasicvsr.py", line 80, in main
    model = init_model(args.config, args.checkpoint)
  File "inference_realbasicvsr.py", line 64, in init_model
    config.model.pretrained = None
  File "/home/alex/anaconda3/envs/vsr3/lib/python3.7/site-packages/mmcv/utils/config.py", line 507, in __getattr__
    return getattr(self._cfg_dict, name)
  File "/home/alex/anaconda3/envs/vsr3/lib/python3.7/site-packages/mmcv/utils/config.py", line 48, in __getattr__
    raise ex
AttributeError: 'ConfigDict' object has no attribute 'model'

Also i check in jupyter notebook the object:

config = mmcv.Config.fromfile(config)

And config contains:

Config (path: configs/realbasicvsr_x4.py): {'argparse': <module 'argparse' from '/home/alex/anaconda3/envs/vsr3/lib/python3.7/argparse.py'>, 'os': <module 'os' from '/home/alex/anaconda3/envs/vsr3/lib/python3.7/os.py'>, 'osp': <module 'posixpath' from '/home/alex/anaconda3/envs/vsr3/lib/python3.7/posixpath.py'>, 'sys': <module 'sys' (built-in)>, 'Pool': <bound method BaseContext.Pool of <multiprocessing.context.DefaultContext object at 0x7f8f1c640d10>>, 'cv2': <module 'cv2' from '/home/alex/anaconda3/envs/vsr3/lib/python3.7/site-packages/cv2/__init__.py'>, 'mmcv': <module 'mmcv' from '/home/alex/anaconda3/envs/vsr3/lib/python3.7/site-packages/mmcv/__init__.py'>, 'np': <module 'numpy' from '/home/alex/anaconda3/envs/vsr3/lib/python3.7/site-packages/numpy/__init__.py'>, 'worker': <function worker at 0x7f8e83b0a170>, 'extract_subimages': <function extract_subimages at 0x7f8e83b0a200>, 'main_extract_subimages': <function main_extract_subimages at 0x7f8e83b0a440>, 'parse_args': <function parse_args at 0x7f8e83b0a050>}
ckkelvinchan commented 2 years ago

I did not encounter this problem before. Did you have any problems when following the installation instruction in the README?

format37 commented 2 years ago

Exactly, i has the same problem, when following the installation instruction in the README. In a new clean conda environment. I gonna try again when back home.

format37 commented 2 years ago

The problem was solved when i install requirments inside base conda environment.
After

conda deactivate