PSYZ1234 / NIDALoc

10 stars 1 forks source link

training code error #1

Closed WanLang0 closed 8 months ago

WanLang0 commented 8 months ago

Hi,your work is excellent.I encountered an error while trying to train your code. Could you please help me take a look.Thanks!

(base) ➜  NIDALoc-main python train.py --dataset_folder /home/featurize/data --dataset Oxford
multi_gpus: False
gpu_id: 0
batch_size: 32
val_batch_size: 32
max_epoch: 99
init_learning_rate: 0.001
decay_step: 500
optimizer: adam
seed: 20
log_dir: NIDALoc/
dataset_folder: /home/featurize/data
dataset: Oxford
num_workers: 4
num_points: 4096
augmentation: []
upright_axis: 2
num_loc: 10
num_ang: 8
skip: 10
steps: 5
normalize: False
real: False
variable_skip: False
skip_val: False
resume_model: 
Traceback (most recent call last):
  File "train.py", line 142, in <module>
    pose_m, pose_s  = np.loadtxt(pose_stats_file) 
  File "/home/featurize/work/.local/lib/python3.7/site-packages/numpy/lib/npyio.py", line 1067, in loadtxt
    fh = np.lib._datasource.open(fname, 'rt', encoding=encoding)
  File "/home/featurize/work/.local/lib/python3.7/site-packages/numpy/lib/_datasource.py", line 193, in open
    return ds.open(path, mode, encoding=encoding, newline=newline)
  File "/home/featurize/work/.local/lib/python3.7/site-packages/numpy/lib/_datasource.py", line 533, in open
    raise IOError("%s not found." % path)
OSError: /home/featurize/data/Oxford/pose_stats.txt not found.

datasetname:oxford_radar_robotcar_dataset_sample_tiny

PSYZ1234 commented 8 months ago

Thank you for your attention. I have uploaded our pose_stats.txt used in the Oxford and NCLT datasets, please refer to the updated content in the data folder. In fact, the pose_stats.txt is regenerated based on the dataset used during each training process, so these numbers are not fixed. You can simply drag them into your code folder.

WanLang0 commented 8 months ago

Thank you for your reply. I have successfully solved the problem. I have a new question about how I am trying to run test.py

(base) ➜  NIDALoc-main python test.py --dataset_folder /home/featurize/data --dataset Oxford --val_batch_size 2 --resume_model work/NIDALoc-main/NIDALoc/checkpoint_epoch7.tar --log_dir /home/featurize/
Traceback (most recent call last):
  File "test.py", line 18, in <module>
    from models.model import BRLoc
ImportError: cannot import name 'BRLoc' from 'models.model' 

It seems like it's just a naming issue. After modifying the from models.model import BRLoc in test.py to from models.model import NIDALoc, I can successfully run the code.

PSYZ1234 commented 8 months ago

We have corrected the typo in test.py. Thank you for your discovery.

WanLang0 commented 8 months ago

Thank you for your reply. I also want to ask, can this pose estimation code be used in a completely unfamiliar new environment after training in the old environment?

PSYZ1234 commented 8 months ago

No, the training and test environment should be the same. The APR network memorizes the scene map into the network, so only a single network is needed to perform inference without using the database map again. If you want to explore its localization ability in unknown scenes, I suggest referring to map based image coordinate regression methods.

WanLang0 commented 8 months ago

OK.I have no problem now.Thank you for your reply.