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

paddle_RN_FSL/reader.py 在windows下运行出错 #1

Open
qqeip opened this issue Aug 3, 2020 · 2 comments
Open

paddle_RN_FSL/reader.py 在windows下运行出错 #1

qqeip opened this issue Aug 3, 2020 · 2 comments

Comments

@qqeip
Copy link

qqeip commented Aug 3, 2020

好几处需要 .replace("\", "/") 转换分割符
def episode_reader(path, episode_num, support_class_num, support_shot_num, query_num, augment=False):
# class_list = os.listdir(path)
class_list = glob.glob(path + '/n*')
#class_list=class_list.replace("\\", "/")
#class_list = [os.path.join(path, c.replace("\", "/")) for c in class_list]
#print(class_list)
if augment:
policy = ImageNetPolicy()
def reader():
for i in range(episode_num):
class_folders = random.sample(class_list, support_class_num)
labels = np.array(range(len(class_folders)))
labels = dict(zip([f.replace("\", "/").split('/')[-1] for f in class_folders], labels))
#print(labels)
samples = dict()

        sample_roots = []
        query_roots = []
        for c in class_folders:
            temp = [os.path.join(c, x) for x in os.listdir(c)]
            temp = [x.replace("\\", "/") for x in temp] 
@txyugood
Copy link
Owner

txyugood commented Aug 3, 2020

我没 windows 设备,所以也没在 windows 上测试,windows 上路径确实需要替换,谢谢反馈。

@zhanglei199609
Copy link

zhanglei199609 commented Mar 16, 2021

好几处需要 .replace("", "/") 转换分割符
def episode_reader(path, episode_num, support_class_num, support_shot_num, query_num, augment=False):

class_list = os.listdir(path)

class_list = glob.glob(path + '/n*')
#class_list=class_list.replace("\", "/")
#class_list = [os.path.join(path, c.replace("", "/")) for c in class_list]
#print(class_list)
if augment:
policy = ImageNetPolicy()
def reader():
for i in range(episode_num):
class_folders = random.sample(class_list, support_class_num)
labels = np.array(range(len(class_folders)))
labels = dict(zip([f.replace("", "/").split('/')[-1] for f in class_folders], labels))
#print(labels)
samples = dict()

        sample_roots = []
        query_roots = []
        for c in class_folders:
            temp = [os.path.join(c, x) for x in os.listdir(c)]
            temp = [x.replace("\\", "/") for x in temp] 

你好,请问你的问题解决了吗?

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

3 participants