Person-reid-GAN-pytorch icon indicating copy to clipboard operation
Person-reid-GAN-pytorch copied to clipboard

no "train_new" file in 'data/market/pytorch/'

Open ping-sun opened this issue 6 years ago • 6 comments

I run the train_baseline and met an error. In the train_baseline.py line176, a file 'train_new' is needed. However, after run 'python prepare.py', I only get 'train' and 'train_all' in file 'data/market/pytorch/'. Also in changeIndex.py line 17, the "train_save_path" is set to "val_new", is there something wrong?

ping-sun avatar Oct 10 '18 03:10 ping-sun

I meet the same error!

XXXxiaoxiaoxia avatar Apr 29 '19 08:04 XXXxiaoxiaoxia

me too! do you know the reason??

Vincy-L avatar Apr 30 '19 15:04 Vincy-L

anyone solved this problem?

Feesics avatar May 20 '19 14:05 Feesics

You can execute this file. This creates the train_new folder.

python re_index.py

---------------------re_index.py------------------------ import os from shutil import copyfile original_path = './data/market/pytorch' def copyfolder(src, dst): files = os.listdir(src) if not os.path.isdir(dst): os.mkdir(dst) for tt in files: copyfile(src + '/' + tt, dst + '/' + tt) new_folders = ['train_new', 'val_new'] old_folders = ['train_all', 'val'] for train, data in zip(new_folders, old_folders): train_save_path = os.path.join(original_path, train) if not os.path.exists(train_save_path): os.mkdir(train_save_path) data_path = os.path.join(original_path, data) if not os.path.isdir(train_save_path): os.mkdir(train_save_path) reid_index = 0 folders = os.listdir(data_path) folders = sorted(folders) for foldernames in folders: copyfolder(data_path + '/' + foldernames, train_save_path + '/' + str(reid_index).zfill(4)) reid_index = reid_index + 1

yunhyuck avatar Jun 01 '19 16:06 yunhyuck

hi, can you help me about this question?

https://github.com/qiaoguan/Person-reid-GAN-pytorch/issues/26

Thank you very much!

Meimeiainaonao avatar Nov 15 '19 12:11 Meimeiainaonao

You can execute this file. This creates the train_new folder.

python re_index.py

---------------------re_index.py------------------------

import os from shutil import copyfile original_path = './data/market/pytorch' def copyfolder(src, dst): files = os.listdir(src) if not os.path.isdir(dst): os.mkdir(dst) for tt in files: copyfile(src + '/' + tt, dst + '/' + tt) new_folders = ['train_new', 'val_new'] old_folders = ['train_all', 'val'] for train, data in zip(new_folders, old_folders): train_save_path = os.path.join(original_path, train) if not os.path.exists(train_save_path): os.mkdir(train_save_path) data_path = os.path.join(original_path, data) if not os.path.isdir(train_save_path): os.mkdir(train_save_path) reid_index = 0 folders = os.listdir(data_path) folders = sorted(folders) for foldernames in folders: copyfolder(data_path + '/' + foldernames, train_save_path + '/' + str(reid_index).zfill(4)) reid_index = reid_index + 1

hi, can you help me about this question?

https://github.com/qiaoguan/Person-reid-GAN-pytorch/issues/26

Thank you very much!

Meimeiainaonao avatar Nov 15 '19 12:11 Meimeiainaonao