Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
format37 opened this issue Mar 12, 2022 · 3 comments
Closed

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

format37 opened this issue Mar 12, 2022 · 3 comments

Comments

@format37
Copy link

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
Copy link
Owner

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

@format37
Copy link
Author

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
Copy link
Author

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

conda deactivate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants