ramdrop / stun

Implementation for the paper: STUN: Self-Teaching Uncertainty Estimation for Place Recognition
BSD 3-Clause "New" or "Revised" License
30 stars 3 forks source link

A question about piits.py #6

Closed shenyehui closed 1 year ago

shenyehui commented 1 year ago

Thank you for your great work! But I have a question about your pitts.py code. Since self.cache = None in line 253, is there no file open in line 270 with h5py.File(self.cache, mode='r') as h5, then the meaning of the code with h5py.File(self.cache, mode='r') as h5 is What?

ramdrop commented 1 year ago

Thanks for your interest.

It is mandatory that embeddings cache be built at the start of training epoch. This ensures that self.cache is not None whenever the __get_item()__ is being executed.

shenyehui commented 1 year ago

Although embedding cache is built at the beginning of training epoch,In class QueryDatasetFromStruct(data.Dataset): def init()...,define self.cache = None,Won't self.cache become none due to this command。 (您好,我还是没能明白,虽然在epoch开始前定义了self.cache的路径,但是在class QueryDatasetFromStruct(data.Dataset)的初始化里面定义了self.cache=none,然后才执行with h5py.File(self.cache, mode='r') as h5,这样不会覆盖前面的命令使得self.cache=none吗?)

ramdrop commented 1 year ago

The execution flow is:

  1. QueryDatasetFromStruct.init(): self.cache=None
  2. Building embeddings: self.cache=[file_path]
  3. QueryDatasetFromStruct.__get_item()__: read from self.cache
  4. repeat 2 and 3
shenyehui commented 1 year ago

Thank you for your patience in answering