This PR addresses multiple import errors encountered during the execution of the run.py script in the VLMEvalKit project. The errors were caused by missing dependencies that were being imported in the code but were not listed in the requirements.txt file.
Reason for the Change:
The following errors were observed in the logs when running the script:
ModuleNotFoundError: No module named 'decord'
This error occurs due to the import statement from decord import VideoReader, cpu in the mvbench.py file. The decord package is necessary for handling video data and should be explicitly included in the requirements.txt file.
ModuleNotFoundError: No module named 'imageio'
This error arises from the import imageio statement in the mvbench.py file. The imageio package is essential for reading and writing image data, and it should also be added to the requirements.txt file.
ModuleNotFoundError: No module named 'peft'
This error occurs due to the import statement from peft import get_peft_model, LoraConfig, TaskType in the vlm.py file. The peft package is essential for working with parameter-efficient fine-tuning (PEFT) models and must be included in the requirements.txt file.
ModuleNotFoundError: No module named 'moviepy'
This error is related to the import statements from moviepy.editor import VideoFileClip, ImageSequenceClip and import moviepy.config_defaults in the mvbench.py file. The moviepy package is essential for video editing operations and needs to be included in the requirements.txt file.
Code Stack Trace:
The relevant stack trace showing the import errors is as follows:
Traceback (most recent call last):
File "/cpfs01/user/limo/workspace/VLMEvalKit/run.py", line 4, in <module>
from vlmeval.config import supported_VLM
File "/cpfs01/user/limo/workspace/VLMEvalKit/vlmeval/__init__.py", line 7, in <module>
from .api import *
File "/cpfs01/user/limo/workspace/VLMEvalKit/vlmeval/api/__init__.py", line 8, in <module>
from vlmeval.dataset import DATASET_TYPE
File "/cpfs01/user/limo/workspace/VLMEvalKit/vlmeval/dataset/__init__.py", line 20, in <module>
from .mvbench import MVBench, MVBench_MP4
File "/cpfs01/user/limo/workspace/VLMEvalKit/vlmeval/dataset/mvbench.py", line 11, in <module>
from decord import VideoReader, cpu
ModuleNotFoundError: No module named 'decord'
Traceback (most recent call last):
File "/cpfs01/user/limo/workspace/VLMEvalKit/vlmeval/dataset/mvbench.py", line 11, in <module>
import imageio
ModuleNotFoundError: No module named 'imageio'
Traceback (most recent call last):
File "/cpfs01/user/limo/workspace/VLMEvalKit/vlmeval/vlm/__init__.py", line 35, in <module>
from peft import get_peft_model, LoraConfig, TaskType
ModuleNotFoundError: No module named 'peft'
Traceback (most recent call last):
File "/cpfs01/user/limo/workspace/VLMEvalKit/vlmeval/dataset/mvbench.py", line 12, in <module>
from moviepy.editor import VideoFileClip, ImageSequenceClip
ModuleNotFoundError: No module named 'moviepy'
Changes Made:
Added decord to requirements.txt
Added imageio to requirements.txt
Added peft to requirements.txt
Added moviepy to requirements.txt
By including these packages in the requirements.txt, we ensure that all necessary dependencies are installed, preventing the aforementioned ModuleNotFoundError from occurring during runtime. This update is critical for maintaining the stability and functionality of the VLMEvalKit project.
This PR addresses multiple import errors encountered during the execution of the
run.py
script in theVLMEvalKit
project. The errors were caused by missing dependencies that were being imported in the code but were not listed in therequirements.txt
file.Reason for the Change:
The following errors were observed in the logs when running the script:
ModuleNotFoundError: No module named 'decord'
from decord import VideoReader, cpu
in themvbench.py
file. Thedecord
package is necessary for handling video data and should be explicitly included in therequirements.txt
file.ModuleNotFoundError: No module named 'imageio'
import imageio
statement in themvbench.py
file. Theimageio
package is essential for reading and writing image data, and it should also be added to therequirements.txt
file.ModuleNotFoundError: No module named 'peft'
from peft import get_peft_model, LoraConfig, TaskType
in thevlm.py
file. Thepeft
package is essential for working with parameter-efficient fine-tuning (PEFT) models and must be included in therequirements.txt
file.ModuleNotFoundError: No module named 'moviepy'
from moviepy.editor import VideoFileClip, ImageSequenceClip
andimport moviepy.config_defaults
in themvbench.py
file. Themoviepy
package is essential for video editing operations and needs to be included in therequirements.txt
file.Code Stack Trace:
The relevant stack trace showing the import errors is as follows:
Changes Made:
decord
torequirements.txt
imageio
torequirements.txt
peft
torequirements.txt
moviepy
torequirements.txt
By including these packages in the
requirements.txt
, we ensure that all necessary dependencies are installed, preventing the aforementionedModuleNotFoundError
from occurring during runtime. This update is critical for maintaining the stability and functionality of theVLMEvalKit
project.