huanghoujing / AlignedReID-Re-Production-Pytorch

Reproduce AlignedReID: Surpassing Human-Level Performance in Person Re-Identification, using Pytorch.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AssertionError

Malathi15 opened this issue · comments

@huanghoujing I downloaded the saved model weights.When i run the code i got the following Assertion Error.Can you please help me with this?

`python script/experiment/train.py -d '(0,)' --dataset market1501 --normalize_feature false -glw 1 -llw 0 -idlw 0 --only_test true --exp_dir /home/ioz/Desktop/Market1501/AlignedReID-Re-Production-Pytorch/run1/test --model_weight_file /home/ioz/Desktop/Market1501/AlignedReID-Re-Production-Pytorch/run1/model_weight.pth

cfg.dict
{'base_lr': 0.0002,
'ckpt_file': '/home/ioz/Desktop/Market1501/AlignedReID-Re-Production-Pytorch/run1/test/ckpt.pth',
'crop_prob': 0,
'crop_ratio': 1,
'dataset': 'market1501',
'exp_decay_at_epoch': 76,
'exp_dir': '/home/ioz/Desktop/Market1501/AlignedReID-Re-Production-Pytorch/run1/test',
'g_loss_weight': 1.0,
'global_margin': 0.3,
'id_loss_weight': 0.0,
'ids_per_batch': 32,
'im_mean': [0.486, 0.459, 0.408],
'im_std': [0.229, 0.224, 0.225],
'ims_per_id': 4,
'l_loss_weight': 0.0,
'local_conv_out_channels': 128,
'local_dist_own_hard_sample': False,
'local_margin': 0.3,
'log_steps': 10000000000.0,
'log_to_file': True,
'lr_decay_type': 'exp',
'model_weight_file': '/home/ioz/Desktop/Market1501/AlignedReID-Re-Production-Pytorch/run1/model_weight.pth',
'normalize_feature': False,
'only_test': True,
'prefetch_threads': 2,
'resize_h_w': (256, 128),
'resume': False,
'run': 1,
'scale_im': True,
'seed': None,
'staircase_decay_at_epochs': (101, 201),
'staircase_decay_multiply_factor': 0.1,
'stderr_file': '/home/ioz/Desktop/Market1501/AlignedReID-Re-Production-Pytorch/run1/test/stderr_2019-08-08_09:55:20.txt',
'stdout_file': '/home/ioz/Desktop/Market1501/AlignedReID-Re-Production-Pytorch/run1/test/stdout_2019-08-08_09:55:20.txt',
'sys_device_ids': (0,),
'test_batch_size': 32,
'test_final_batch': True,
'test_mirror_type': None,
'test_set_kwargs': {'batch_dims': 'NCHW',
'batch_size': 32,
'final_batch': True,
'im_mean': [0.486, 0.459, 0.408],
'im_std': [0.229, 0.224, 0.225],
'mirror_type': None,
'name': 'market1501',
'num_prefetch_threads': 2,
'part': 'test',
'prng': <module 'numpy.random' from '/home/ioz/.local/lib/python2.7/site-packages/numpy/random/init.pyc'>,
'resize_h_w': (256, 128),
'scale': True,
'shuffle': False},
'test_shuffle': False,
'total_epochs': 150,
'train_final_batch': False,
'train_mirror_type': 'random',
'train_set_kwargs': {'batch_dims': 'NCHW',
'crop_prob': 0,
'crop_ratio': 1,
'final_batch': False,
'ids_per_batch': 32,
'im_mean': [0.486, 0.459, 0.408],
'im_std': [0.229, 0.224, 0.225],
'ims_per_id': 4,
'mirror_type': 'random',
'name': 'market1501',
'num_prefetch_threads': 2,
'part': 'trainval',
'prng': <module 'numpy.random' from '/home/ioz/.local/lib/python2.7/site-packages/numpy/random/init.pyc'>,
'resize_h_w': (256, 128),
'scale': True,
'shuffle': True},
'train_shuffle': True,
'trainset_part': 'trainval',
'weight_decay': 0.0005}

Traceback (most recent call last):
File "script/experiment/train.py", line 632, in
main()
File "script/experiment/train.py", line 316, in main
train_set = create_dataset(**cfg.train_set_kwargs)
File "./aligned_reid/dataset/init.py", line 54, in create_dataset
partitions = load_pickle(partition_file)
File "./aligned_reid/utils/utils.py", line 24, in load_pickle
assert osp.exists(path)
AssertionError
`

Thanks in advance

Hello, do you have solved the above problem? I have the same problem as yours.

Check if your dataset is in the path "~/Dataset/market1501"
Or print the path variable and check if it is a valid path

Had the same issue..
Fixed it by correcting the partitions.pkl location in ./aligned_reid/dataset/init.py file