Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ping-sun opened this issue Oct 10, 2018 · 6 comments
Open

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

ping-sun opened this issue Oct 10, 2018 · 6 comments

Comments

@ping-sun
Copy link

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?

@XXXxiaoxiaoxia
Copy link

I meet the same error!

@Vincy-L
Copy link

Vincy-L commented Apr 30, 2019

me too! do you know the reason??

@Feesics
Copy link

Feesics commented May 20, 2019

anyone solved this problem?

@yunhyuck
Copy link

yunhyuck commented Jun 1, 2019

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

@Meimeiainaonao
Copy link

hi, can you help me about this question?

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

Thank you very much!

@Meimeiainaonao
Copy link

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?

#26

Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants