I am trying to run my script but I am getting the following error, and i don't know what is the circular import which is the cause of this error, can anyone fix this pls
AttributeError Traceback (most recent call last) Input In [5], in <cell line: 1>()
---> 1 from inference import convert_video
3 convert_video(
4 model, # The model, can be on any device (cpu or cuda).
5 input_source=r"C:\Users\alaba\Desktop\RobustVideoMatting-master\test.mp4",
A video file or an image sequence directory.
(...) 12 seq_chunk=12, # Process n frames at once for better parallelism. 13 )
File ~\Desktop\RobustVideoMatting-master\inference.py:22, in 19 from typing import Optional, Tuple 20 from tqdm.auto import tqdm ---> 22 from inference_utils import VideoReader, VideoWriter, ImageSequenceReader, ImageSequenceWriter 24 def convert_video(model, 25 input_source: str, 26 input_resize: Optional[Tuple[int, int]] = None, (...) 36 device: Optional[str] = None, 37 dtype: Optional[torch.dtype] = None): 39 """ 40 Args: 41 input_source:A video file, or an image sequence directory. Images must be sorted in accending order, support png and jpg. (...) 55 dtype: Only need to manually provide if model is a TorchScript freezed model. 56 """
File ~\Desktop\RobustVideoMatting-master\inference_utils.py:3, in
1 import av
2 import os
----> 3 import pims
4 import numpy as np
5 from torch.utils.data import Dataset
File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\pims_init_.py:1, in ----> 1 from pims.api import * 3 from ._version import get_versions 4 version = get_versions()['version']
File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\pims\api.py:33, in
31 try:
32 import pims.pyav_reader
---> 33 if pims.pyav_reader.available():
34 PyAVReaderTimed = pims.pyav_reader.PyAVReaderTimed
35 PyAVReaderIndexed = pims.pyav_reader.PyAVReaderIndexed
AttributeError: partially initialized module 'pims' has no attribute 'pyav_reader' (most likely due to a circular import)