fenglinglwb / MAT

MAT: Mask-Aware Transformer for Large Hole Image Inpainting
Other
759 stars 84 forks source link

questions with places512 trainning #48

Open YIFanH opened 1 year ago

YIFanH commented 1 year ago

HI @fenglinglwb ,thanks for your work, i use source code to train places2 datasets, but meet the self._load_raw_image out of bounds in datasets/dataset_512.py, but executing this file alone is no problem. thanks for your reply!

fenglinglwb commented 1 year ago

Please provide more error information.

YIFanH commented 1 year ago

In datasets/dataset_512.py line 218,raw_idx > total files number in trainning,for example , 992 imgs in test forder, IndexError: index 992 is out of bounds for axis 0 with size 992. def _load_raw_image(self, raw_idx): fname = self._image_fnames[raw_idx] with self._open_file(fname) as f: if pyspng is not None and self._file_ext(fname) == '.png': image = pyspng.load(f.read()) else: image = np.array(PIL.Image.open(f)) if image.ndim == 2: image = image[:, :, np.newaxis] # HW => HWC

fenglinglwb commented 1 year ago

Please check the metric you used. For example, when adopting 'fid36k5', we need to prepare 36.5k images. Just select a proper metric.

YIFanH commented 1 year ago

Please check the metric you used. For example, when adopting 'fid36k5', we need to prepare 36.5k images. Just select a proper metric. thanks for your reply , I update fid_places in metrics/metric_main.py like this: def fid_places(opts): opts.dataset_kwargs.update(max_size=None, xflip=False)

fid = frechet_inception_distance.compute_fid(opts, max_real=36500, num_gen=36500)

fid = frechet_inception_distance.compute_fid(opts, max_real=900, num_gen=900) return dict(fid36k5_full=fid) and run with --metrics fid_places.

but I meet other cuda memory problems,batchsize irrelevance.

fenglinglwb commented 1 year ago

Which error?

YIFanH commented 1 year ago

in trainning cuda memory out with one V100 gpu batch with 8,i guess somthing wrong with cuda mem is not cleared.

fenglinglwb commented 1 year ago

This needs to be solved by yourself

YIFanH commented 1 year ago

yes , i need read code more, thanks for your work and reply