baidut / PatchVQ

Patch-VQ: ‘Patching Up’ the Video Quality Problem

Home Page:https://baidut.github.io/PatchVQ

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error running "test_PVQ_on_new_datasets.ipynb"

SmithLiu95 opened this issue · comments

There is an error when I run "test_PVQ_on_new_datasets.ipynb" on Colab. I only changed the "dir" parameter sent to SingleVideo2MOS.from_dict. Could you help me with this? Thank you very much.

WARNING:root:setattr roi_col not existed
WARNING:root:roipool: size = (2, 2), scale = 1/32
WARNING:root:setattr vid_id not existed

0%| | 0/22 [00:00<?, ?it/s]WARNING:root:setattr split_mode not existed
Loading data...G005

AttributeError Traceback (most recent call last)
in ()
32 e = IqaExp('exp_features', gpu=0, seed=None)
33 e[name] = learn
---> 34 e.run(lambda x: [get_features(x, name, bs=bs, vid_id=vid_id) for vid_id in tqdm(vid_list)])

7 frames
/content/PatchVQ/fastiqa/iqa_exp.py in run(self, func, destroy, append)
149
150 if type(self.gpu) is int:
--> 151 func(learn)
152 else: # None or True/False (cpu or multi-gpus)
153 ctx = learn.parallel_ctx

in (x)
32 e = IqaExp('exp_features', gpu=0, seed=None)
33 e[name] = learn
---> 34 e.run(lambda x: [get_features(x, name, bs=bs, vid_id=vid_id) for vid_id in tqdm(vid_list)])

in (.0)
32 e = IqaExp('exp_features', gpu=0, seed=None)
33 e[name] = learn
---> 34 e.run(lambda x: [get_features(x, name, bs=bs, vid_id=vid_id) for vid_id in tqdm(vid_list)])

in get_features(x, name, bs, vid_id)
9 x.dls.bs = bs
10 x.dls.set_vid_id(vid_id)
---> 11 x.extract_features(name=name, skip_exist=True)
12 except RuntimeError:
13 tmp_bs = bs

/content/PatchVQ/fastiqa/learn.py in extract_features(self, on, name, cache, skip_exist)
122 if hasattr(self.model, 'rois'):
123 self.model.rois = None
--> 124 preds = self.get_preds() # get preds on one video with several batches
125 self.model.output_features = old_setting
126

/usr/local/lib/python3.7/dist-packages/fastai/learner.py in get_preds(self, ds_idx, dl, with_input, with_decoded, with_loss, act, inner, reorder, cbs, **kwargs)
225 def get_preds(self, ds_idx=1, dl=None, with_input=False, with_decoded=False, with_loss=False, act=None,
226 inner=False, reorder=True, cbs=None, **kwargs):
--> 227 if dl is None: dl = self.dls[ds_idx].new(shuffled=False, drop_last=False)
228 if reorder and hasattr(dl, 'get_idxs'):
229 idxs = dl.get_idxs()

/content/PatchVQ/fastiqa/bunch.py in getitem(self, index)
156 if self._loading or self._bunching:
157 raise AttributeError(f"index={index}: '{self}' data not loaded yet. loading={self._loading}, bunching={self._bunching}")
--> 158 return self._data[index]
159
160 def getattr(self, k: str):

/content/PatchVQ/fastiqa/bunch.py in getattr(self, k)
161 # fail to get attributes, fetch it from self.data
162 if self._loading or self._bunching:
--> 163 raise AttributeError(f"key={k}: '{self}' data not loaded yet. loading={self._loading}, bunching={self._bunching}")
164 return getattr(self._data, k)
165

AttributeError: key=_data: 'G005' data not loaded yet. loading=True, bunching=False

I have extract the frames for G005
!ls data/LIVE_VQC_tiny/jpg/G005 | wc -l
#return: 301

老哥解决了嘛