Repository: open-compass/opencompass
Issue: [Bug] 使用mmbench测试miniGPT4的样例程序报错
Root cause: Documentation Deficiency

### Describe the bug

描述
修改文件minigpt_4_7b_mmbench.py的minigpt4_model的llama_model参数和minigpt_4_load_from参数，执行python run.py ./configs/multimodal/minigpt_4/minigpt_4_7b_mmbench.py --mm-eval --debug -w outputs/minigpt_4命令，报错如下。
Traceback (most recent call last):
  File "/home/taas/lidan6/opencompass/run.py", line 372, in <module>
    main()
  File "/home/taas/lidan6/opencompass/run.py", line 213, in main
    tasks = partitioner(cfg)
  File "/home/taas/lidan6/opencompass/opencompass/partitioners/mm_naive.py", line 99, in __call__
    models = cfg['models']
  File "/home/taas/anaconda3/envs/opencompass/lib/python3.10/site-packages/mmengine/config/config.py", line 1483, in __getitem__
    return self._cfg_dict.__getitem__(name)
  File "/home/taas/anaconda3/envs/opencompass/lib/python3.10/site-packages/mmengine/config/config.py", line 131, in __getitem__
    return self.build_lazy(super().__getitem__(key))
  File "/home/taas/anaconda3/envs/opencompass/lib/python3.10/site-packages/mmengine/config/config.py", line 98, in __missing__
    raise KeyError(name)
KeyError: 'models'
定位问题：错误原因是没有读到模型，感觉框架内部参数传递中间格式错了

### Environment

环境配置无误，LLM模型评测可以跑通

### Other information

_No response_

执行python run.py ./configs/multimodal/tasks.py --mm-eval --debug -w outputs/minigpt_4，报错信息如下：
08/05 10:11:38 - OpenCompass - INFO - Partitioned into 1 tasks.
08/05 10:11:38 - OpenCompass - DEBUG - Task 0: minigpt-4-mmbench-opencompass.MMBenchDataset-opencompass.DumpResults
08/05 10:11:38 - OpenCompass - DEBUG - Modules of opencompass's task registry have been automatically imported from opencompass.tasks
08/05 10:11:38 - OpenCompass - DEBUG - Get class `MultimodalInferTask` from "task" registry in "opencompass"
/home/taas/anaconda3/envs/opencompass/lib/python3.10/site-packages/mmengine/utils/manager.py:113: UserWarning: <class 'mmengine.logging.logger.MMLogger'> instance named of OpenCompass has been created, the method `get_instance` should not accept any other arguments
  warnings.warn(
08/05 10:11:38 - OpenCompass - DEBUG - An `MultimodalInferTask` instance is built from registry, and its implementation can be found in opencompass.tasks.mm_infer
Traceback (most recent call last):
  File "/home/taas/lidan6/opencompass/run.py", line 372, in <module>
    main()
  File "/home/taas/lidan6/opencompass/run.py", line 214, in main
    exec_mm_infer_runner(tasks, args, cfg)
  File "/home/taas/lidan6/opencompass/run.py", line 316, in exec_mm_infer_runner
    runner(tasks)
  File "/home/taas/lidan6/opencompass/opencompass/runners/base.py", line 38, in __call__
    status = self.launch(tasks)
  File "/home/taas/lidan6/opencompass/opencompass/runners/local.py", line 57, in launch
    task.run()
  File "/home/taas/lidan6/opencompass/opencompass/tasks/mm_infer.py", line 88, in run
    init_dist(self.cfg.launcher)
  File "/home/taas/anaconda3/envs/opencompass/lib/python3.10/site-packages/mmengine/dist/utils.py", line 88, in init_dist
    _init_dist_slurm(backend, init_backend=init_backend, **kwargs)
  File "/home/taas/anaconda3/envs/opencompass/lib/python3.10/site-packages/mmengine/dist/utils.py", line 177, in _init_dist_slurm
    proc_id = int(os.environ['SLURM_PROCID'])
  File "/home/taas/anaconda3/envs/opencompass/lib/python3.10/os.py", line 680, in __getitem__
    raise KeyError(key) from None
KeyError: 'SLURM_PROCID'


只支持分布式系统吗？launcher = 'slurm' # only support slurm, pytorch, mpi

配置修改：修改minigpt4路径，在/opencompass/opencompass/multimodal/models/minigpt_4/minigpt_4.py文件里修改的
运行命令：python run.py ./configs/multimodal/tasks.py --mm-eval -w ./outputs/minigpt --debug
报错信息：
  File "/home/taas/lidan6/opencompass/opencompass/tasks/mm_infer.py", line 97, in run
    dataloader = Runner.build_dataloader(self.dataloader)

KeyError: "class `MMBenchDataset` in opencompass/multimodal/datasets/mmbench.py: 'mmpretrain.torchvision/Resize is not in the transform registry. Please check whether the value of `mmpretrain.torchvision/Resize` is correct or it was registered as expected. More details can be found at https://mmengine.readthedocs.io/en/latest/advanced_tutorials/config.html#import-the-custom-module'"


Thank you for your interests in MMBench. You can follow these instructions below to evaluate MiniGPT-4:
1. Install [MMPretrain](https://github.com/open-mmlab/mmpretrain/tree/main)
2. Replace [llama_model](https://github.com/InternLM/opencompass/blob/af436f5951d25e0ed0f6ec66431f39ce6a02c801/configs/multimodal/minigpt_4/minigpt_4_7b_mmbench.py#L31) and [minigpt_4_load_from](https://github.com/InternLM/opencompass/blob/af436f5951d25e0ed0f6ec66431f39ce6a02c801/configs/multimodal/minigpt_4/minigpt_4_7b_mmbench.py#L42) with your local paths.
3. Change [launcher](https://github.com/InternLM/opencompass/blob/af436f5951d25e0ed0f6ec66431f39ce6a02c801/configs/multimodal/tasks.py#L15) to `pytorch`
4.  `python run.py configs/multimodal/tasks.py --mm-eval`

PS: You can change [num_gpus](https://github.com/InternLM/opencompass/blob/af436f5951d25e0ed0f6ec66431f39ce6a02c801/configs/multimodal/tasks.py#L13) according to your needs.

5. Change [minigtp_4_env_path](https://github.com/InternLM/opencompass/blob/main/opencompass/multimodal/models/minigpt_4/minigpt_4.py) with my local env path ( line 29: sys.path.append() )

It works with all above instructions, thanks

@YuanLiuuuuuu Please update the documentation to provide detailed instructions.

Feel free to re-open this issue if needed.

@jodie2235337 
Change [minigtp_4_env_path](https://github.com/InternLM/opencompass/blob/main/opencompass/multimodal/models/minigpt_4/minigpt_4.py) with my local env path ( line 29: sys.path.append() )
It works with all above instructions, thanks

---------------------------------------------------------------------------------------
@jodie2235337 您好，这个问题请问您是怎么解决的？我在跑minigpt4的评测代码是遇到了和您一模一样的错误
执行命令：python -m torch.distributed.launch run.py configs/multimodal/tasks.py --mm-eval
错误信息：raise KeyError(
KeyError: 'mmpretrain.torchvision/Resize is not in the mmengine::transform registry. Please check whether the value of `mmpretrain.torchvision/Resize` is correct or it was registered as expected. More details can be found at https://mmengine.readthedocs.io/en/latest/advanced_tutorials/config.html#import-the-custom-module'）

安装mmpretrian，conda opencompass环境下，使用pip install mmpretrain

> 安装mmpretrian，conda opencompass环境下，使用pip install mmpretrain

这些都安了，仍然报那个错误，代码也是最新的

> > 安装mmpretrian，conda opencompass环境下，使用pip install mmpretrain
> 
> 这些都安了，仍然报那个错误，代码也是最新的

python，import mmpretrain，正常吗？我之前这样报错，缺少mmcv，pip装上就好了

> 5. Change [minigtp_4_env_path](https://github.com/InternLM/opencompass/blob/main/opencompass/multimodal/models/minigpt_4/minigpt_4.py) with my local env path ( line 29: sys.path.append() )
> 
> It works with all above instructions, thanks

您好！抱歉叨扰您了。请问使用mmbench测试minigpt4的时候，是要在opencompass环境下执行代码吗？然后将minigpt4自己的环境路径添加到脚本里面吗？这个环境路径大概是什么样子的呢？

> > 5. Change [minigtp_4_env_path](https://github.com/InternLM/opencompass/blob/main/opencompass/multimodal/models/minigpt_4/minigpt_4.py) with my local env path ( line 29: sys.path.append() )
> > 
> > It works with all above instructions, thanks
> 
> 您好！抱歉叨扰您了。请问使用mmbench测试minigpt4的时候，是要在opencompass环境下执行代码吗？然后将minigpt4自己的环境路径添加到脚本里面吗？这个环境路径大概是什么样子的呢？

You can follow this [doc](https://github.com/open-compass/opencompass/tree/main/configs/multimodal/minigpt_4) to prepare your environment.